title: How to validate an Email in PHP?
body: <p>How can I validate the input value is a valid email address using php5. Now I am using this code </p>
  
  <pre><code>function isValidEmail($email){ 
       $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; 
  
       if (eregi($pattern, $email)){ 
          return true; 
       } 
       else { 
          return false; 
       }    
  } 
  </code></pre>
  
  <p>but it shows deprecated error. How can I fix this issue. Please help me.</p>