Here is a very simple function that will generate a string of random characters, ideal if you want to create a password for a new user.
function generatePassword($length=10) { $pass = ''; } return $pass; }
Use the function like this.
echo generatePassword();
To create a longer password string just pass a parameter with the function.
echo generatePassword(5);
0 comments:
Post a Comment