How To Validate Email Addresses in PHP
erics, Posted October 21st, 2012 at 4:55:51pm
1 2 3 4 5 6 |
$valid = validateEmailAddress('yourName@yourDomain.com'); function validateEmailAddress($email = '') { // returns 1 for valid and 0 for invalid return (int) (filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match('/@.+\./', $email)); } |
Leave Your Comment
All fields marked with "*" are required.