Skip to content

Instantly share code, notes, and snippets.

@kokx
Created December 30, 2010 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kokx/759375 to your computer and use it in GitHub Desktop.
Save kokx/759375 to your computer and use it in GitHub Desktop.
#!/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