Home >Backend Development >PHP Tutorial >一个产生随机密码的php函数_PHP
一个产生随机密码的函数
--------------------------------------------------------------------------------
function MakePass($length)
{
$possible = "0123456789!@#$%^&*()_+".
"abcdefghijklmnopqrstuvwxyz".
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$str = "";
while(strlen($str)
{
$str .= substr($possible, (rand() % strlen($possible)), 1);
}
return($str);
}
?>
原作者:KobraPHP
来源:http://www.evilwalrus.