We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

ajbatac on 01/11/08


Tagged

email validation


Versions (?)


Who likes this?

5 people have marked this snippet as a favorite

vali29
vilebender
soroush
kdaviesnz
JimiJay


Valid email address


Published in: PHP 


  1. function valid_email($str)
  2. {
  3. return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
  4. }

Report this snippet 

You need to login to post a comment.