Функция проверки валидности email

function validEmail($email = '') { $result = false; $email = filter_var($email, FILTER_VALIDATE_EMAIL); if ($email) { $arr = explode("@",$email); $result = getmxrr($arr[1], $a); } return $result; } var_dump(validEmail('mail@gcom.com'));