Voting

: three minus one?
(Example: nine)

The Note You're Voting On

darek at module17 dot com
12 years ago
Simple password generation function using sprintf and the %c type specifier; which is the same as chr().

function genPass($len = 8) {
for ($i=0;$i<=$len;$i++) {
$passwd = sprintf('%s%c', isset($passwd) ? $passwd : NULL, rand(48, 122));
}
return $passwd;
}

<< Back to user notes page

To Top