Home > Article > Backend Development > QQ special characters php randomly generates 10-digit character codes
Copy code The code is as follows:
function randStr($len)
{
$chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; // characters to build the password from
$string= '';
for(;$len> ;=1;$len--)
{
$position=rand()%strlen($chars);
$string.=substr($chars,$position,1);
}
return $string;
}
echo randStr(10)."
";
The above introduces the qq special characters PHP randomly generates 10-digit character codes, including the content of qq special characters. I hope it will be helpful to friends who are interested in PHP tutorials.