PHP: Random password with numbers and letters
function genRandomString() {
$length = 10;
$characters = ’0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’;
$string = ”;
for ($p =
0;
$p <
$length;
$p++
) { $string .=
$characters[mt_rand(0,
strlen($characters))];
}
return $string;
}
No comments:
Post a Comment