note 41537 deleted from function.ereg by nlopess
| From: | nlopess@php.net | Date: | Wed, 14 Apr 2004 14:25:07 +0000 |
| Subject: | note 41537 deleted from function.ereg by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68120@lists.php.net to get a copy of this message | ||
Note Submitter: benanatbenandotnet
----
Small addition to the email validation code that Andreas sent. This code supports emails in
email123@email123.com format which are valid aswell.
if (ereg("^([A-Za-z0-9_\.]*)@([A-Za-z0-9_]*)\.([A-Za-z_\.]*)$", $email) ) {
echo "valid";
else {
echo "invalid";
}