You should check results before making a negative rating on a snippet.
Via http://us3.php.net/checkdnsrr, checkdnsrr() will return either TRUE or FALSE; true for success, and false for everything else.
If you do a list($var1, $var2) = explode('@', $string) and there is no '@', then $var2 will be null.
If you then turn around and do checkdnsrr($var2, 'MX'), then the result will be FALSE; as expected. So therefore, this snippet does work and does work correctly.
I've got good news, and I've got bad news:
The universe is merely a figment of my imagination.
Now are you ready for the bad news?
Regards,
Kumar S
GuyFromChennai.com
Via http://us3.php.net/checkdnsrr, checkdnsrr() will return either TRUE or FALSE; true for success, and false for everything else.
If you do a list($var1, $var2) = explode('@', $string) and there is no '@', then $var2 will be null.
If you then turn around and do checkdnsrr($var2, 'MX'), then the result will be FALSE; as expected. So therefore, this snippet does work and does work correctly.
Will this script work on a Windows server?
http://bytemycode.com/snippets/snippet/377/
I would add the code above to this script as a revision or comment.