当前位置:Gxlcms > PHP教程 > php随机密码生成器

php随机密码生成器

时间:2021-07-01 10:21:17 帮助过:26人阅读

  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. //use two syllables...
  7. for($i=0;$i < 2; $i++){
  8. $pw .= $c[rand(0, strlen($c)-1)];
  9. $pw .= $v[rand(0, strlen($v)-1)];
  10. $pw .= $a[rand(0, strlen($a)-1)];
  11. }
  12. //... and add a nice number
  13. $pw .= rand(10,99);
  14. return $pw;
  15. }

php

人气教程排行