function return_number () {
// set password length
$pw_length = 18;
// set ASCII range for random character generation
$lower_ascii_bound = 48; // "0"
$upper_ascii_bound = 57; // "9"
// Exclude special characters and some confusing alphanumerics
// o,O,0,I,1,l etc
$notuse = array (58,59,60,61,62,63,64,73,79,91,92,93,94,95,96,108,111);
while ($i < $pw_length) {
mt_srand ((double)microtime() * 1000000);
// random limits within ASCII table
$randnum = mt_rand ($lower_ascii_bound, $upper_ascii_bound);
if (!in_array ($randnum, $notuse)) {
$password = $password . chr($randnum);
$i++;
}
}
return $password;
$new_password = return_number();
}
$new_password = return_number();
echo "$new_password";
echo return_number();