Skip to main content

Validation of email in php

 
 
Validation of email address in php
function is_valid_email($email) {
  $result = TRUE; 
if(!eregi 
("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email))
  {
    $result = FALSE;
  }
  return $result;
}
 
Use this function and pass the email address which you get from the your field....
 
 
:) 

Comments