Created
January 6, 2014 18:43
-
-
Save bmcculley/8287410 to your computer and use it in GitHub Desktop.
Random pronounceable password generator
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
<?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