One of the links lead me to this code....you will have to figure what you want the password to be:
Unfortunately, it is not very well written. For example, it uses substr() when string indexing will do, a while loop when a for loop more clearly expresses the loop, a hard coded number of iterations, and srand(), which is no longer necessary. I would suggest:
function createRandomPassword($length = 8) {
$chars = "abcdefghijkmnopqrstuvwxyz023456789";
$max = strlen($chars) - 1;
$pass = '' ;
for ($i = 0; $i < $length; ++$i) {
$pass .= $chars[mt_rand(0, $max)];
}
return $pass;
}
In the function below, do I store a value in this line - $pass = ' ' ?
You would use the return value of the function, e.g.,
$password = createRandomPassword();