Validate email address in php


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

URL: http://daipratt.co.uk

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.