Last active
November 12, 2020 13:18
-
-
Save taner-dll/db4518121d739215dc0d063c4e93c5d1 to your computer and use it in GitHub Desktop.
PHP - Check Valid Email #php #email #validation
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 | |
// check for valid email address | |
$email = $_POST['remail']; | |
$pattern = '/^[^@]+@[^srn'";,@%]+$/'; | |
if (!preg_match($pattern, trim($email))) { | |
$error[] = 'Please enter a valid email address'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment