Last active
August 29, 2015 14:09
-
-
Save IftiMahmud/d6bcbf88371a951d33ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// basic email validation, needs to be updated to support new longer domains | |
$email = '[email protected]'; | |
$regex = "/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i"; | |
$valid = preg_match( $regex, $email ) ? 'yes' : 'no'; | |
?> | |
<strong>Email:</strong> <?php echo $email ?><br /> | |
<strong>Valid:</strong> <?php echo $valid ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment