Some Cool PHP Techniques

I came across a nice roundup of PHP techniques that might have slipped through the fingers of those new to the language, there were a few in there that even I didn’t know about. Including this one:

Partially validate email addresses by checking that the domain name exists with checkdnsrr(). This built-in function checks to ensure that a specified domain name resolves to an IP address. A simple user-defined function that builds on checkdnsrr() to partially valid email addresses can be found in the user comments section in the PHP docs. This is handy for catching those occasional folks who think their email address is ‘joeuser@wwwphp.net’ instead of ‘joeuser@php.net’.

Leave a Reply