Home » PHP Code »

0

<?php
echo password_generate(6,6);

function password_generate($min=6,$max=6){

/*has a default minimum value of 6  and maximum value of 6*/

$password=”";

// this variable is for to save generated password

for($i=0;$i<rand($min,$max);$i++){

$num=rand(48,122);

if(($num >= 97 && $num <= 122)) $pwd.=chr($num);

else if(($num >= 65 && $num <= 90)) $pwd.=chr($num);

else if(($num >=48 && $num <= 57)) $pwd.=chr($num);

else $i–;

}
return $password;

// returns the generated password
}

?>

It displays the random password feild with using the php code.

Hope this will be useful.



Related Posts

    View more option in simple phpHow to create custom error log files in php?Auto post into Blogspot using php code?PHP Charts with using Google API

 

Leave a Reply