RE: Checking string for invalid characters...[THANKS]
| From: | Marcelo J. Iturbe | Date: | Thu, 06 Jul 2000 17:18:23 +0000 |
| Subject: | RE: Checking string for invalid characters...[THANKS] | ||
| Groups: | php.general php.general | ||
| Request: | Send a blank email to php-general+get-5246@lists.php.net to get a copy of this message | ||
Thanks for your help!
I ended up using the following: This confirms that the first character has to be from a-z and any following character can be a-z,0-9,-,_
$login = strtolower($login);
$length = strlen($login) -1;
if ( ereg( "([a-z]{1})([a-z,-,_,0-9]{$length})", $login, $regs ) ) {
echo "valid Login....";} else {
echo "Invalid Login...";}