Skip to content

Instantly share code, notes, and snippets.

@sjimenez77
Created January 2, 2013 10:27
Show Gist options
  • Save sjimenez77/4433630 to your computer and use it in GitHub Desktop.
Save sjimenez77/4433630 to your computer and use it in GitHub Desktop.
PHP: comprobar sintaxis email
function is_valid_email($email)
{
$result = TRUE;
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) {
$result = FALSE;
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment