Archive for April, 2008

Quick and easy way to validate email strings. I picked this bit of code up from somewhere, not sure where….Think it was the Zend site. Credit goes to the original unknown author, not me. <?php function is_email($address) { $rc1 = (ereg(‘^[-!#$%&'*+./0-9=?A-Z^_`a-z{|}~]+’. ‘@’. ‘[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+.’. ‘[-!#$%&'*+\./0-9=?A-Z^_`a-z{|}~]+$’, $address)); $rc2 = (preg_match(‘/.+.ww+$/’,$address)); return ($rc1 && $rc2); } ?>

Quick tip for you PHP/Opera Users!

In Opera, go to Tools –> Preferences, and click on the search tab. You should “Add a new search engine” and fill in the blanks. Here is what I use:. Name: PHP Keyword: p Address: http://www.php.net/search.php Query string: pattern=%s&show=quickref You have to check “Use POST” to be able to type in a query string. Click [...]