一个产生随机密码的php函数_PHP
程序员文章站
2022-06-14 19:37:02
...
一个产生随机密码的函数
--------------------------------------------------------------------------------
function MakePass($length)
{
$possible = "0123456789!@#$%^&*()_+".
"abcdefghijklmnopqrstuvwxyz".
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$str = "";
while(strlen($str)
{
$str .= substr($possible, (rand() % strlen($possible)), 1);
}
return($str);
}
?>
原作者:KobraPHP
来源:http://www.evilwalrus.
--------------------------------------------------------------------------------
function MakePass($length)
{
$possible = "0123456789!@#$%^&*()_+".
"abcdefghijklmnopqrstuvwxyz".
"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$str = "";
while(strlen($str)
{
$str .= substr($possible, (rand() % strlen($possible)), 1);
}
return($str);
}
?>
原作者:KobraPHP
来源:http://www.evilwalrus.