function
RandPassword($length)
{
srand(date("s"));
$charactors
= "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$string =
"";
while(strlen($string)<$length)
{
$string
.= substr($charactors, rand()%(strlen($charactors))),1);
}
return($string);
}
echo
RandPassword(7);
No comments:
Post a Comment