Posted By

daipratt on 04/14/10


Tagged

form email php validate


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

tannerc
titosemi


Validate email address in php


 / Published in: PHP
 

URL: http://daipratt.co.uk

  1. function isValidEmail($email){
  2. $result = eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);
  3.  
  4. if ($result == true){
  5. return $email;
  6. }else{
  7. return "";
  8. }
  9. }

Report this snippet  

You need to login to post a comment.