PHP头条
热点:

php随机生成10位字符代码


代码如下:
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)."
";

www.phpzy.comtrue/php/9018.htmlTechArticlephp随机生成10位字符代码 代码如下: function randStr($len) { $chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz'; // characters to build the password from $string=''; for(;$len>=1;$len--) { $position=rand()%st...

相关文章

相关频道:

PHP之友评论

今天推荐