Password Strength Check
| From: | Michael Conley | Date: | Sun, 31 Dec 2000 19:21:09 +0000 |
| Subject: | Password Strength Check | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-32284@lists.php.net to get a copy of this message | ||
I want to require that a user choose a password that contains at least 6
characters, at least 2 of which must be letters (upper of lower case) and 2
must be non-characters (numbers or special characters). I'm having a tough
time figuring out how to do this. I can use substr_count to check for the
number of occurences of a character, but I don't want to check for each
letter, each number and each special character for this check. Is there
anything that can be used like the ereg option that use [0-9] and [a-zA-Z]?
I originally was using ereg, but couldn't figure out how to make that do
what I wanted as I don't care what order the letter, number and special
characters are in within the password.
Bottom line- if someone types in what they want to change their password to,
how can I check it to ensure that it meets the requirements above?