Created
September 14, 2012 02:11
-
-
Save bobpattersonjr/3719387 to your computer and use it in GitHub Desktop.
Check Email Domain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkEmailDomain($email) { | |
if(preg_match('/^([a-zA-Z0-9_])+([a-zA-Z0-9\.+_-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/', $email)){ | |
list($username,$domain)=split('@',$email); | |
if(!checkdnsrr($domain,'MX')) { | |
return false; | |
} | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment