0
I need to fix via PHP programming, incorrect emails registered in our database.
Would be emails without domain, with space in any position, with ". @", "@." without "@", any character not allowed in EMAIL.
0
I need to fix via PHP programming, incorrect emails registered in our database.
Would be emails without domain, with space in any position, with ". @", "@." without "@", any character not allowed in EMAIL.
Browser other questions tagged php html sql
You are not signed in. Login or sign up in order to post.
I don’t know if I meant what you want to do, but I imagine it would be pointless to try to correct an email without dominion, precisely because you don’t know which domain. But if you just remove some unwanted characters I think you can do this with regex: https://www.tutorialspoint.com/php/php_regular_expression.htm
– Victor Hartur de Carvalho
Hello welcome to Stack Overflow @Alanhenrique, could post what you’ve already tried?
– Marconi
Correct, would it delete this record from the database? Which database? It would be better to do it directly in the database. Or Voce wants when to include a wrong record via front, the back already ignore and not even record these records?
– David
PHP already has its own function. Regex + email usually only gives disaster. The rule for email is too big and complex. There are a lot of people who advertise too simplified Regex on websites, get away from it. If you are going to use Regex limit yourself to what you said, check if you have arroba, space, and if you have a point at least right, at most this. It is frustrating for a user to try to register a valid email, and fail. Much worse than passing an invalid (and, anyway, will only know if an email is actually valid when sending successfully).
– Bacco
@Bacco could be an answer
– Math
@Math I’m pretty sure is dup, just not given time to look.
– Bacco
@Bacco essa? http://answall.com/q/8067/3117
– Math
@Math think that: http://answall.com/questions/8134/verifi-se-vari%C3%a1vel-cont%C3%a9m-um-Ndere%C3%a7o-de-email-well-formatted-in-php
– Bacco