Posted By

Turek on 01/30/11


Tagged

email validation


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

riacharda
felipefermin


Email Validation


 / Published in: PHP
 

  1. function checkEmail($mail) {
  2. return preg_match("/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $mail);
  3. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: riacharda on March 18, 2011

Doesn't work. I typed a real email address and it still failed. I get this error:

preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 12

You need to login to post a comment.