Posted By

antti on 08/08/11


Tagged

email php textmate validation


Versions (?)

Validate email address


 / Published in: Other
 

  1. /**
  2. * Validate email address
  3. * @param string $email Email address to validate
  4. * @return bool Returns TRUE if valid
  5. */
  6. public static function validate($email) {
  7. return preg_match("/^[A-Za-z0-9_!#$%*/?|^{}`~&'+-=]+(.[A-Za-z0-9_!#$%*/?|^{}`~&'+-=]+)*@[A-Za-z0-9-]+(.[A-Za-z0-9-]+)*(.[A-Za-z0-9-]{2,6})$/", $email);
  8. }

Report this snippet  

You need to login to post a comment.