導航:首頁 > 編程語言 > php訂單編號生成

php訂單編號生成

發布時間:2023-05-29 11:04:55

㈠ 怎麼用JS或php實現自動生成單據編號(以10+當天日期的格式)

php:
$number
=
"10".date("Ymd",time());
可以得到10開頭緊接年月日及時間(到秒)如1020120603
$number
=
"10".date("YmdHis",time());
可以得到10開頭緊接年月日及時間(到秒)如1020120603231120
如果怕有重復可以在接一些隨機數
$number
.=
rand(1000,9999);

㈡ thinkphp訂單號怎麼生成

function build_order_no() {

return date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);

}

function guid() {

if (function_exists('com_create_guid')) {

return com_create_guid();

} else {

mt_srand((double)microtime()*10000);

$charid = strtoupper(md5(uniqid(rand(), true)));

$hyphen = chr(45);

$uuid = chr(123)

.substr($charid, 0, 8).$hyphen

.substr($charid, 8, 4).$hyphen

.substr($charid,12, 4).$hyphen

.substr($charid,16, 4).$hyphen

.substr($charid,20,12)

.chr(125);

return $uuid;

}

}

㈢ php生成訂單編號的幾種方法

第一種

第二種慎悔消寬知

第三種

第四種

第五種前纖

㈣ php 如何生成訂單號

訂單號一般是根據用戶ID,購買時間,商品ID生成的模李笑,
比如用戶ID:123,購買時間:1353364885,商擾啟品ID:567,
則訂單號可旦含以是:123-1353364885-567

閱讀全文

與php訂單編號生成相關的資料

熱點內容
騰訊雲企業雲伺服器多少錢 瀏覽:3
程序員擺地攤彈唱 瀏覽:370
本田App怎麼連接愛車 瀏覽:775
男士買衣服在哪個app實惠 瀏覽:690
安卓車機怎麼顏色反轉 瀏覽:901
手機uc下載的文件夾 瀏覽:963
程序員評論南京 瀏覽:88
冠道怎麼連接安卓車載 瀏覽:318
手機怎麼把兩張圖片做成文件夾 瀏覽:722
抖音導出表格發貨加密 瀏覽:133
自己電腦怎麼模擬成伺服器 瀏覽:553
單片機的Vpp是 瀏覽:351
iua編譯器下載官方 瀏覽:85
壓縮機高低壓快速平衡 瀏覽:875
phpai 瀏覽:709
怎麼不被命令 瀏覽:88
大話緣定三生伺服器什麼便宜 瀏覽:968
idea編譯內部類 瀏覽:468
pdf2word在線轉換 瀏覽:589
tim儲存在哪個文件夾 瀏覽:623