Created
December 30, 2010 02:19
-
-
Save kokx/759375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
function genChildName($min = 4, $max = 11, $consonants = 'aoiue', $noncons = 'qwrtpsdfghjklzxcvwnmy') | |
{ | |
$len = rand($min, $max); | |
$name = ''; | |
for ($i = 0; $i < $len; $i++) { | |
if ($i % 2 == 0) { | |
$name .= $noncons[rand(0, strlen($noncons) - 1)]; | |
} else { | |
$name .= $consonants[rand(0, strlen($consonants) - 1)]; | |
} | |
} | |
return $name; | |
} | |
echo genChildName() . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment