Source for file SimpleCheck.php

Documentation is available at SimpleCheck.php

  1. <?php
  2.  
  3. /**
  4.  * Primitive email validation class based on the regexp found at
  5.  * http://www.regular-expressions.info/email.html
  6.  */
  7. {
  8.     
  9.     public function validate($string$config$context{
  10.         // no support for named mailboxes i.e. "Bob <bob@example.com>"
  11.         // that needs more percent encoding to be done
  12.         if ($string == ''return false;
  13.         $string trim($string);
  14.         $result preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i'$string);
  15.         return $result $string false;
  16.     }
  17.     
  18. }

Documentation generated on Thu, 19 Jun 2008 18:50:20 -0400 by phpDocumentor 1.4.2