Home >> Snippet List >> Snippet

Name
Validate email address #2
Description
Validates an email address format
PHP Snippet
<?PHP
 
FUNCTION checkEmail($email) {
     IF (EREG("^[a-zA-Z0-9][a-zA-Z0-9_\.\-]*[@][a-zA-Z0-9\.\-]*[\.][a-zA-Z]{2,4}$", $email)) {
          RETURN TRUE;
     } ELSE {
          RETURN FALSE;
     }
}
 
?>