3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'abdeddf@hotmail.com'; $pattern = '/^[A-Z0-9.-]+\.[A-Z]{2,}\b/i'; function validEmail($email){ // Check the formatting is correct if(filter_var($email, FILTER_VALIDATE_EMAIL) === false){ return FALSE; } // Next check the domain is real. $domain = explode("@", $email, 2); var_dump($domain); return checkdnsrr($domain[1], 'MX'); // returns TRUE/FALSE; } var_dump(validEmail($str));
based on h0f99
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
array(2) { [0]=> string(7) "abdeddf" [1]=> string(11) "hotmail.com" } bool(false)