您的位置: 首页 > IT文章 > php 生成订单号 php 生成订单号 分类: IT文章 • 2023-11-06 21:34:53 最近在练手一个订单提交的小项目,需要用到生成订单号,网上找了下,觉得这个最好。 function build_order_no(){ return date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8); }