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

php 隨機生成10位字符代碼

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

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>";


相關文章

最新評論