欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php 隨機(jī)生成10位字符代碼

 更新時(shí)間:2009年03月26日 11:31:09   作者:  
php 隨機(jī)生成10位字符,大家可以看下原理就可以實(shí)現(xiàn)自定義位數(shù)的隨機(jī)字符串了。
復(fù)制代碼 代碼如下:

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)."<br>";


相關(guān)文章

最新評(píng)論