THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

PHP FILTER_SANITIZE_EMAIL Filter

PHP Filter Reference PHP Filter Reference

Example

Remove all illegal characters from an email address:

<?php
$email = "john(.doe)@exa//mple.com";

$email = filter_var($email, FILTER_SANITIZE_EMAIL);
echo $email;
?>
Run example »

Definition and Usage

The FILTER_SANITIZE_EMAIL filter removes all illegal characters from an email address.


PHP Filter Reference PHP Filter Reference