//产生8位16进制随机数
$rand = mt_rand(0x00000000, 0xffffffff);// make sure we're not over 0xffffff, which shouldn't happen anyway
$rand = dechex($rand & 0xffffffff); // add zeroes in front of the generated string //如果有0确保0在首位
$rand = str_pad($rand, 8, '0', STR_PAD_LEFT);
php:产生8位16进制随机数
最新推荐文章于 2022-09-27 21:30:45 发布