I have the following code:
$email = '[email protected]';
echo $email.'<br>';
echo filter_var('[email protected]',FILTER_SANITZE_EMAIL).' SANITIZED-EMAIL';
and it the output is as follows:
[email protected]
SANITIZED-EMAIL
Clearly the email is completely turned into an empty string. Similarly the filter_var
with FILTER_SANITIZE_STRING
does the same thing. What am I missing here?
Your code does give errors:
It has to be
FILTER_SANITIZE_EMAIL
notFILTER_SANITZE_EMAIL
- so it's just a typo.