function randStr($len)
{
$chars ='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; // 从
$string=''构建密码的字符;
for(;$len>=1;$len--)
{
$position=rand()%strlen($chars);
$string.=substr($chars,$position,1);
}
返回 $string;
}
echo randStr(10)."
";