12-06-2007, 05:01 PM
|
#16 (permalink)
|
|
The Acquainted
Join Date: Sep 2007
Posts: 133
Thanks: 6
|
If you need one for an email address (here's something i came across in my functions file, not sure who's it is, but it's not mine)
PHP Code:
function check_email($email) { if(preg_match('/^\w[-.\w]*@(\w[-._\w]*\.[a-zA-Z]{2,}.*)$/', $email, $matches)) { if(function_exists('checkdnsrr')) { if(checkdnsrr($matches[1] . '.', 'MX')) return true; if(checkdnsrr($matches[1] . '.', 'A')) return true; }else{ if(!empty($hostName)) { if( $recType == '' ) $recType = "MX"; exec("nslookup -type=$recType $hostName", $result); foreach ($result as $line) { if(eregi("^$hostName",$line)) { return true; } } return false; } return false; } } return false; }
|
|
|