Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* Valida un email usando filter_var y comprobar las DNS.
* Devuelve true si es correcto o false en caso contrario
* @param string $str la dirección a validar
* @return boolean
function is_valid_email($str)
$result = (false !== filter_var($str, FILTER_VALIDATE_EMAIL));
if ($result)
list($user, $domain) = split('@', $str);
$result = checkdnsrr($domain, 'MX');
return $result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.