Skip to content

Instantly share code, notes, and snippets.

@skoshy
Last active November 29, 2016 19:51
Show Gist options
  • Save skoshy/6f76af85846e376ede8e668a74cdc46e to your computer and use it in GitHub Desktop.
Save skoshy/6f76af85846e376ede8e668a74cdc46e to your computer and use it in GitHub Desktop.
<?
/*
Using filter_var and check the domain part contains a dot
From http://www.electrictoolbox.com/php-email-validation-filter-var-updated/
Check link for a series of tests
*/
function emailValidate($email) {
return filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match('/@.+\./', $email);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment