Assuming the following email address:
$email = "zuúl@ so.pt";
I tried to clean it using:
filter_var($email, FILTER_SANITIZE_EMAIL); // [email protected]
I've also tried:
preg_replace('/[[:punct:]]/', '', $email); // zuúl sopt
The idea is that because the user type an accent or white space by mistake is not forced back "back" to rectify the address because this type of scenarios can be controlled by the application taking the work to the user. / p>
Question
How to sanitize email address zuúl@ so.pt
so that it stays [email protected]
?