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