FILTER_SANITIZE_EMAIL constant in PHP

PHPProgrammingServer Side Programming

The FILTER_SANITIZE_EMAIL constant deletes all illegal characters from an email address.

Return

The FILTER_SANITIZE_EMAIL constant does not return anything.

Example

<?php
   $myemail = "abc@demo//.com";
   $myemail = filter_var($myemail, FILTER_SANITIZE_EMAIL);
   echo $myemail;
?>

Output

The following is the output.

abc@demo.com
raja
Published on 04-Dec-2018 07:31:25
Advertisements