Home > Backend Development > PHP Tutorial > Password random function_PHP tutorial

Password random function_PHP tutorial

WBOY
Release: 2016-07-13 17:09:01
Original
880 people have browsed it

function make_password()
{$pw_length=24;//密码长度
$low_ascii_bound=50;
$upper_ascii_bound=122;
$notuse=array(58,59,60,61,62,63,64,73,79,91,92,93,94,95,96,108,111);
while($i<$pw_length)
{mt_srand((double)microtime()*1000000);
$randnum=mt_rand($low_ascii_bound,$upper_ascii_bound);
if(!in_array($randnum,$notuse))
{$password1=$password1.chr($randnum);
$i ;
}
}
return $password1;}
$password=make_password();//调用
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/629778.htmlTechArticle? function make_password() {$pw_length=24;//密码长度 $low_ascii_bound=50; $upper_ascii_bound=122; $notuse=array(58,59,60,61,62,63,64,73,79,91,92,93,94,95,96,108,111); while($i$...
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