A function that validates e-mail addresses with dns lookup and syntax check
<?php public function validate_email($str) { if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $str)) return false; list($usr, $domain) = split('@', $str); if (!@checkdnsrr($domain,'MX')) return false; return true; } ?>
0 comments:
Post a Comment