note 11065 deleted from ereg by jmoore
| From: | jmoore@php.net | Date: | Wed, 14 Feb 2001 20:16:46 +0000 |
| Subject: | note 11065 deleted from ereg by jmoore | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11082@lists.php.net to get a copy of this message | ||
if("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email) ) {
echo "e-mail adress is OK";
}
I always used this code to validate an e-mail address. The only thing You should change is the
length of the TLD from 2,3 to 2-6 :-) so Your validation script will accept the new Top Level Domain
extensions.