PHP email validation question?
- by GeNx
Will this email validation allow foreign email address like russian, hebrew and so on? And how can I just check for the @ sign?
Here is the php code.
if (preg_match ('/^[\w.-]+@[\w.-]+\.[A-Za-z]{2,6}$/', $_POST['email'])) {
$email = mysqli_real_escape_string($mysqli, strip_tags($_POST['email']));
} else {
echo '<p class="error">Please enter a valid email address!</p>';
}