how do i validate a username/password using ereg/eregi?
requirement for username is
- min. 3 character, max. 12 character
- first character range from a-z
- any characters in the middle range from a-z, 0-9, -, _
- last character range from a-z, 0-9
requirement for password
- min, 3 chars, max 12 chars
- all characters range from a-z, 0-9
username example
abc123 - valid
-abc123 - invalid
_abc123 - invalid
abc123- - invalid
123abc - invalid
a123_cb2d - valid
Is there any good reference for ereg?
I found the example in the php help file is not complete.
Thanks!