<?PHP
function createRandomStr($length){
$str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';//62个字符
$strlen = 62;
while($length > $strlen){
$str .= $str;
$strlen += 62;
}
$str = str_shuffle($str);
return substr($str,$length);
}
//生成十个随机字符
echo createRandomStr(10);
/*** 以上代码来自 jb51.cc ***/
?>
原文链接:https://www.f2er.com/php/529246.html