Home >php教程 >php手册 >一个产生随机密码的函数

一个产生随机密码的函数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-21 09:12:491131browse

函数|随机|随机密码

一个产生随机密码的函数




function MakePass($length)
{
$possible = "0123456789!@#$%^&*()_+".
             "abcdefghijklmnopqrstuvwxyz".
             "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$str = "";
while(strlen($str) {
  $str .= substr($possible, (rand() % strlen($possible)), 1);
}
return($str);
}
?>  

原作者:KobraPHP  
来源:http://www.evilwalrus.com



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