evValidEmail | checks if a given string is a valid e-mail address


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

only checks if the string contains @, . and alphanumeric characters


Copy this code and paste it in your HTML
  1. // name: evValidEmail
  2. // version: v0.1
  3. // description: chequea que sea un email valido
  4.  
  5. function evValidEmail( $email ) {
  6.  
  7. if ( !eregi( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email ) ) : return true;
  8. else: return false;
  9. endif;
  10.  
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.