Random pronounceable passwords generator


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function auth_pwgen(){
  2. $pw = '';
  3. $c = 'bcdfghjklmnprstvwz'; //consonants except hard to speak ones
  4. $v = 'aeiou'; //vowels
  5. $a = $c.$v; //both
  6.  
  7. //use two syllables...
  8. for($i=0;$i < 2; $i++){
  9. $pw .= $c[rand(0, strlen($c)-1)];
  10. $pw .= $v[rand(0, strlen($v)-1)];
  11. $pw .= $a[rand(0, strlen($a)-1)];
  12. }
  13. //... and add a nice number
  14. $pw .= rand(10,99);
  15.  
  16. return $pw;
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.