Home > Backend Development > PHP Tutorial > 一个产生随机密码的函数_PHP

一个产生随机密码的函数_PHP

WBOY
Release: 2016-06-01 12:36:26
Original
828 people have browsed it

一个产生随机密码的函数




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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template