Posted By

bsisco on 05/05/08


Tagged

php


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

mmccrack


valid_email function


 / Published in: PHP
 

this function was provided to me by my partner in crime......thanks superchicken

  1. function valid_email($str)
  2. {
  3. $match = "/^([a-zA-Z0-9]([a-zA-Z0-9_-]*\.?[a-zA-Z0-9])*)(\+[a-zA-Z0-9]+)?@([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])*\.)*([a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9]+)*)\.[a-zA-Z]{2,6}$/";
  4. if(preg_match($match, $str)) {
  5. return TRUE;
  6. }else{
  7. return FALSE;
  8. }
  9. }

Report this snippet  

You need to login to post a comment.