这是我抛出错误的代码(来自 submit.php):
$email_from = $_POST['email']; // required
$error_message = "";
$email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
if(!eregi($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
我知道我需要使用 preg_match,但我不知道如何实现它。我已经阅读了文档,但我仍然不明白。谢谢!