function Random_password () {
$maxlen = 6; # Default to 6
# Build tables of vowels & consonants. Single vowels are repeated so
# resultant words are not dominated by dipthongs
$vowel = Array ("A", "E", "I", "O", "U", "Y", "AI", "au", "ay", "EA", "ee", "EU", "ia", "ie", "io", "OA", "Oi", "oo", "oy") ;
$consonant = Array ("B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Qu", "R", "s", "T", "V", "w", "X", "Z", " Th "," st "," sh "," ph "," ng "," nd ");
$password = "";
Srand (Double) microtime () *1000000);
$vowelnext = (int) rand (0,1); # initialise to 0 or 1 (ie true or false)
do {
if ($vowelnext) {
$password = $password. $vowel [Rand (0,sizeof ($vowel))];
} else {
$password = $password. $consonant [Rand (0,sizeof ($consonant))];
}
$vowelnext =! $vowelnext; # Swap Letter type for the next one
while (strlen ($password) < $maxlen);
return $password;
}