valid_email function


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.