Skip to content

Instantly share code, notes, and snippets.

@WenLiangTseng
Created July 22, 2013 06:14
Show Gist options
  • Save WenLiangTseng/6051640 to your computer and use it in GitHub Desktop.
Save WenLiangTseng/6051640 to your computer and use it in GitHub Desktop.
PHP產生一個訂單編號(獨一無二的訂單編號)
<?php
$stamp = strtotime("now");
$orderid = $stamp - $_SERVER['REMOTE_ADDR'];
$orderid = str_replace(".", "", $orderid);
?>
@dca
Copy link

dca commented Jan 17, 2015

您好,
這個做法產生的編號可能回有重複問題,為避免有人從搜尋引擎過來誤用,在此留言敬請見諒。

提供社團的討論串供您參考:
https://www.facebook.com/groups/199493136812961/permalink/734360609992875/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment