Home >Backend Development >PHP Tutorial >php random password generator

php random password generator

WBOY
WBOYOriginal
2016-07-25 08:43:071360browse
  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


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn