Re: mail address validation
| From: | jmcazurin | Date: | Mon, 27 Nov 2000 14:29:04 +0000 |
| Subject: | Re: mail address validation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27372@lists.php.net to get a copy of this message | ||
At 10:15 PM 11/27/00, Michael Buerkle wrote:
does anybody know a function in php4 to easily validate if an email adress give by the user is in the valid somebody@somewhere.topleveldom form? or did anybody ever write a function for doing that and is willing to share it with me?Hi Michael - Q&D solution:
if(!ereg("^.+@.+\\..+$", $emailAddress)) {
//
// $emailAddress is invalid
//
}
It will pass some weird cases though, e.g., '@@@.@'
Hope this helps,
Mikah