Validate an email address with filter_var() and the FILTER_VALIDATE_EMAIL flag.
Source Code
$email = "[email protected]";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo "This is a valid email address.";
} else {
echo "Invalid email address.";
}