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

一个产生随机密码的函数

WBOY
Release: 2016-06-21 09:12:49
Original
1097 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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template