<?php
$email_a = 'joe@example.com';
$email_b = 'bogus';
if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
echo " $email_a is valid email.";
}
if (filter_var($email_b, FILTER_VALIDATE_EMAIL)) {
echo " '$email_b' is valid email.";
} else {
echo "$email_b ooops NOT VALID try again";
}
?>