Generate Password using PHP

by Manigandan 2012-10-05 16:42:20


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);
1002
like
0
dislike
0
mail
flag

You must LOGIN to add comments