Skip to content

Instantly share code, notes, and snippets.

@CodeNegar
Created September 19, 2012 10:06
Show Gist options
  • Save CodeNegar/3748816 to your computer and use it in GitHub Desktop.
Save CodeNegar/3748816 to your computer and use it in GitHub Desktop.
php: validate email
<?php
public static function validate_email($email)
{
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $address)) ? FALSE : TRUE;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment