Monthly Archives: April 2012

PHP5 Email verification

Amazing how so many people have such long and complex answers to a simple question. Question: How do you validate a email address in PHP5? Answer: function validemail($var) { if (filter_var(filter_var($var, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL)) { list($username,$domain)=split(‘@’,$var); if(!checkdnsrr($domain,’MX’)) { return false; } return true; } return false; } Damn people…. it wasn’t that hard!!! Once I gaveā€¦ Read More »