Generate Password using PHP
by Manigandan[ Edit ] 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);