经测试代码如下:
<?PHP
/**
* 随机密码生成
*
* @param
* @arrange (512.笔记) jb51.cc
**/
function auth_pwgen(){
$pw = '';
$c = 'bcdfghjklmnprstvwz'; //consonants except hard to speak ones
$v = 'aeIoU'; //vowels
$a = $c.$v; //both
//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 $pw;
}
/*** 来自:编程之家 jb51.cc(jb51.cc) ***/
?>
原文链接:https://www.f2er.com/php/528797.html