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

lmcdougall on 09/13/07


Tagged

php


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

luman
bartekk
gedittest
vali29
hudge
Abe
stancell


Validate email


Published in: PHP 


  1. function is_valid_email($email)
  2. {
  3. if(preg_match("/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email) > 0)
  4. return true;
  5. else
  6. return false;
  7. }

Report this snippet 

You need to login to post a comment.