note 16554 deleted from function.ereg by jimw
| From: | jimw@php.net | Date: | Sun, 04 Nov 2001 05:52:43 +0000 |
| Subject: | note 16554 deleted from function.ereg by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20412@lists.php.net to get a copy of this message | ||
Sorry, i submitted the wrong code;
I would prefer this code to check an email-address:
$email = "very_strange.email-address___@very-very.very.long.domain.coop";
if(ereg("^[0-9a-z]([-_.]?[0-9a-z])*[_]*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$", $email))
{
echo $email . " is valid";
}
else
{
echo $email . " is invalid";
}
btw: this one would be valid