Welcome to the Linux community forum and interact with 2 million technical staff to enter the example of generating random passwords in php. This method is novel and different from the various methods circulating on the Internet to generate random passwords, you can specify the length and perform simple special settings. Example of generating random passwords in php for your reference. Sample Code :? Php ** auto-generated
Welcome to the Linux community forum and interact with 2 million technical staff> go to the php community to generate a random password example. This method is novel and different from the various methods circulating on the Internet to generate random passwords, you can specify the length and perform simple special settings. Example of generating random passwords in php for your reference. Sample Code :? Php/** auto-generated
Welcome to the Linux community forum and interact with 2 million technicians>
Example of generating a random password in php. This method is novel. Different from the various methods used to generate random passwords on the Internet, you can specify the length and perform simple special settings.
Example of generating random passwords in php for your reference.
Sample Code:
/**
Automatically generate Password
*/
Function password (length, special ){
Var iteration = 0;
Var password = "";
Var randomNumber;
If (special = undefined ){
Var special = false;
}
While (iteration <length ){
RandomNumber = (Math. floor (Math. random () * 100) % 94) + 33;
If (! Special ){
If (randomNumber >=33) & (randomNumber <= 47) {continue ;}
If (randomNumber >=58) & (randomNumber <= 64) {continue ;}
If (randomNumber >=91) & (randomNumber <= 96) {continue ;}
If (randomNumber >=123) & (randomNumber <= 126) {continue ;}
}
Iteration ++;
Password + = String. fromCharCode (randomNumber );
}
Return password;
}
?>
Usage:
Sample Code:
/**
Example of a random password call
*/
Password (8 );
// Outputs: Yrc7TxX3
Password (12, true );
// Outputs: C} 4_ege! P & # M
?>