Home  >  Article  >  Backend Development  >  QQ special characters php randomly generates 10-digit character codes

QQ special characters php randomly generates 10-digit character codes

WBOY
WBOYOriginal
2016-07-29 08:39:441190browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn