Return to Snippet

Revision: 50729
at August 31, 2011 09:33 by Jotape


Initial Code
<?
function validaEmail($email){ 
	if(filter_var($email, FILTER_VALIDATE_EMAIL))
	{
	$separa = list($usuario, $provedor) = explode('@', $email);
	if(getmxrr($separa[1], $mx_records, $mx_weight))
		return $separa[0].'@'.$separa[1];
	else
		return false;
	}
	return false;
}

echo validaEmail('[email protected]');//false

echo validaEmail('[email protected]');//true
?>

Initial URL

                                

Initial Description
Verifica se o e-mail e o dominio são válidos.

Initial Title
Validate Email and Domain

Initial Tags
php

Initial Language
PHP