Skip to content

Instantly share code, notes, and snippets.

@taner-dll
Last active November 12, 2020 13:18
Show Gist options
  • Save taner-dll/db4518121d739215dc0d063c4e93c5d1 to your computer and use it in GitHub Desktop.
Save taner-dll/db4518121d739215dc0d063c4e93c5d1 to your computer and use it in GitHub Desktop.
PHP - Check Valid Email #php #email #validation
<?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