Skip to content

Instantly share code, notes, and snippets.

@bmcculley
Created January 6, 2014 18:43
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmcculley/8287410 to your computer and use it in GitHub Desktop.
Save bmcculley/8287410 to your computer and use it in GitHub Desktop.
Random pronounceable password generator
<?php
/*
* Random pronounceable password generator
*
* Found the orignal function here http://bit.ly/1iKeLBO
* Added in a capital letter.
*/
function rppg(){
$pw = '';
$c = 'bcdfghjklmnprstvwz'; // consonants except hard to speak ones
$v = 'aeiou'; // vowels
$a = $c.$v; // all
//use two syllables...
for($i=0;$i < 2; $i++){
$pw .= $c[rand(0, strlen($c)-1)];
$pw .= $v[rand(0, strlen($v)-1)];
$pw .= $a[rand(0, strlen($a)-1)];
}
//... and add a nice number
$pw .= rand(10,99);
return ucfirst($pw);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment