Skip to content

Instantly share code, notes, and snippets.

@slav123
Created December 5, 2013 04:09
Show Gist options
  • Save slav123/7799930 to your computer and use it in GitHub Desktop.
Save slav123/7799930 to your computer and use it in GitHub Desktop.
simple regexp to check if email is valid
<?php
function is_valid_email($email) {
if(preg_match("/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/", $email) > 0)
return true;
else
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment