<html>
<body>
$email = "john.doe@example.com";
// Remove all illegal characters from email
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
// Validate e-mail
if (!filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
echo("$email is a valid email address");
} else {
echo("$email is not a valid email address");
}
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_filter6 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:29:33 GMT -->
</html>