PHP 自定义长度字符串生成函数,可方便用于生成激活码,邀请码
function randstr($len=6){
$chars='abcdefghijklmnopqrstuvwxyz0123456789';
mt_srand((double)microtime()*1000000*getmypid());
$password='';
while(strlen($password)<$len)
$password.=substr($chars,(mt_rand()%strlen($chars)),1);
return $password;
}如果本文对你有帮助,欢迎打赏本站

支付宝扫码打赏
微信扫码打赏
