function get_rand($length){
$chars= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
srand((double)microtime()*1000000);
$randStr = "";
for($i=0; $i<$length; $i++) {
$index = rand()%strlen($chars);
$randStr.= $chars[$index];
}
return $randStr;
}
PHP随机字符串,随机密码
猜你喜欢
转载自blog.csdn.net/qq_27702329/article/details/104840901
今日推荐
周排行