PHP Regex: IsValidEmail


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



Copy this code and paste it in your HTML
  1. function isValidEmail($value){
  2. $pattern = "/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/";
  3. return preg_match($pattern, $value);
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.