Skip to content

Instantly share code, notes, and snippets.

@pedromenezes
Created August 13, 2009 01:34
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 pedromenezes/166909 to your computer and use it in GitHub Desktop.
Save pedromenezes/166909 to your computer and use it in GitHub Desktop.
<?
function genRandomAndReadableString($numberOfLetters)
{
for ($letter = 1, $string = '', $letters = 'aeioubcdfghjlmnpqrstvxz'; $letter <= $numberOfLetters; $letter++)
{
$string .= $letters[($letter % 2 ? rand(5,22) : rand(0,4))];
}
return $string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment