3
Assuming the following email address:
$email = "zuúl@ so.pt";
I tried to proceed to sanitize the same by making use of:
filter_var($email, FILTER_SANITIZE_EMAIL); // [email protected]
I tried too:
preg_replace('/[[:punct:]]/', '', $email); // zuúl sopt
The idea is that by the fact that the user type an accent or a blank space by mistake is not forced to go "back" to rectify the address because this type of scenarios can be controlled by the application taking the work of the user.
Question
How to sanitize your email address zuúl@ so.pt
to keep [email protected]
?
It seems to me that he’s also talking about special characters, not just spaces
– CesarMiguel
@Cesarmiguel attention failure my... already corrected the answer :)
– Willy Stadnick
A doorway of
#zuúl@ so.pt
results in:[email protected]
usingsetlocale(LC_ALL,'pt_PT.utf8')
. Impeccable.– Zuul