- //php generates a new password function
- function genPassword($min = 5, $max = 8)
- {
- $validchars="abcdefghijklmnopqrstuvwxyz123456789";
- $max_char=strlen($validchars)-1;
- $length=mt_rand($min,$ max);
- $password = "";
- for($i=0;$i<$length;$i )
- {
- $password. =$validchars[mt_rand(0,$max_char)];
- }
- return $password;
- }
- echo "New password:". genPassword()."
";
- echo "New password:".genPassword(5,10)."
";
-
http://www.bkjia.com/PHPjc/486149.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486149.htmlTechArticle?php //php generate new password function function genPassword($min = 5, $max = 8) { $ validchars="abcdefghijklmnopqrstuvwxyz123456789"; $max_char=strlen($validchars)-1; $length=mt_rand($min,...
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