$email = "abc@gmail.com"; if(filter_var($mail, FILTER_VALIDATE_EMAIL)) { echo "這是正確的 E-mail"; else echo "這是不正確的 E-mail"; }