![](file:///D:/%E7%AB%99%E7%82%B9%E5%A4%87%E4%BB%BD/3.8/Zp_www.xawxhl.com/static/picture/21916819_1662362193.png)
|
西安網站建設公司——西安無限互聯教您在PHP生(shēng)成不重複的内部訂單号時間:2018-02-01 文章内容
西安網站建設公司——西安無限互聯教您在PHP生(shēng)成不重複的内部訂單号: 西安網站建設PHP生(shēng)成不重複的内部訂單号,代碼如下(xià): function generateJnlNo() { date_default_timezone_set('PRC'); $yCode = array('A','B','C','D','E','F','G','H','I','J'); $orderSn = ''; $orderSn .= $yCode[(intval(date('Y')) - 1970) % 10]; $orderSn .= strtoupper(dechex(date('m'))); $orderSn .= date('d').substr(time(), -5); $orderSn .= substr(microtime(), 2, 5); $orderSn .= sprintf('%02d', mt_rand(0, 99)); return $orderSn; } |