文章转自:https://blog.csdn.net/llfdhr/article/details/53330841
//随机生成一个由16位数字组成的字符串function rand_num($num=16){$n=[];for($i=0;$i<$num;$i++){$n[$i] = $i;}for($i=0;$i<$num;$i++){$rand = mt_rand($i,$num-1);//数组 随机数交换下标if($n[$i] == $i){$n[$i] = $n[$rand];$n[$rand] = $i;}}//将数组转化为字符串返回$a=implode('',$n);return $a;}
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号