Created
July 12, 2018 06:09
-
-
Save dirkeinecke/e8d7c8d16be04fb30f9962e8ed3364b2 to your computer and use it in GitHub Desktop.
This PHP function checks if the email address is syntactically correct.
This file contains 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 check_email_address($email_address) { | |
if ($email_address !== '') { | |
$result = filter_var($email_address, FILTER_VALIDATE_EMAIL); | |
if ($result === FALSE) { | |
return false; // email address is not valid | |
} else { | |
return true; // email address is valid | |
} | |
} else { | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment