PHP生成唯一订单号 阿星小栈

 

/**
*
* uniqid - 官方是这样说的:
* Gets a prefixed unique identifier based on the current time in microseconds.
*/
function build_order_no()
{
    return date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
}

 

 

 

 


原文:https://blog.csdn.net/chajinglong/article/details/52598757 

posted @ 2018-11-15 13:17  阿星小栈  阅读(176)  评论(0编辑  收藏  举报