How To Validate Email Addresses in PHP
erics, October 21st, 2012
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)); } |