Description
Get Random Password function generates random string that can be used for variety of purpose, it has given this name
because many times, we need to generate a random password for database related operations.
Function Defination
void function getRandomPassword($length = 8, $allow_special_character = false) ;
Parameters Details
| Details | Type | Example |
|---|---|---|
| $length - length of string | int | 9 |
| $allow_special_character - whether to allow special characters | boolean | true/false |
Examples
$pdomodel = new PDOModel(); //create object of the PDOModel class
echo $pdomodel->getRandomPassword();
More Examples
//Example 1
echo $pdomodel->getRandomPassword(15, true);
Result/Output
Returns random string