generate()
generate(integer $length = 12, boolean $special_chars = true, boolean $extra_special_chars = false) : string
Generates a random password drawn from the defined set of characters.
Uses random_lib
library to create passwords with far less predictability.
Parameters
integer | $length | Optional. The length of password to generate. Default 12. |
boolean | $special_chars | Optional. Whether to include standard special characters. Default true. |
boolean | $extra_special_chars | Optional. Whether to include other special characters. Default false. |
Returns
string —The system generated password.