Two methods of generating order number in PHP
<?php function build_order_no(){ return date('YmdHis').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 6); } echo build_order_no(); ?>
<?php function getOrderId(){ date_default_timezone_set('Asia/Shanghai'); $time= date('YmdHis',time()); $randsix = rand('100000','999999'); return $time.$ randsix; } echo getOrderId(); ?>