Created
April 14, 2019 20:06
-
-
Save stefpe/cdb6b5778e9b9e56524d64238b022838 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
function validateMail(string $email): bool | |
{ | |
$parts = explode("@", $email); | |
$host = end($parts); | |
return checkdnsrr($host, 'MX'); | |
} | |
$email = '[email protected]'; | |
validateMail($email); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment