Validating email address format php
That’s 27 stabs at the keyboard that could go awry.Any mistype will result in an invalid email address.[epiphany]Even if the sun shone through my window and I was visited by a particularly savage sneeze (I suffer from Autosomal Dominant Compelling Helio-Ophthalmic Outburst Syndrome*) and I typed out #! ^_`|[email protected] mistake, I would still pass the most thorough email ‘validation’ techniques. ^_`|[email protected] she said she gets super pissed off when told that her email address isn’t valid. For example hitting the neighbouring ‘h’ key instead of ‘g’.We all know that the pinky is the retarded cousin of the finger family, so that is factored in as well. And again, those bad keys are only invalid in certain circumstances.And since it’s more likely that the shift key would be down only for the letters on either side of the @ symbol, and ‘l’ on either side of the @ is considered particularly dangerous. It goes without saying that I’ve gone to a similar level of effort to account for soft keyboards.This is to verify that I actually own that email address before my account is activated.At this point, why keep parsing email addresses for their format?
Let’s imagine that my email address is [email protected]
The result of sending an email to a badly formatted email address would be the same: it’ll get bounced. If you really want to do checking of email addresses right on the signup page, include a confirmation field so they have to type it twice.
If your user enters a bad email address, they won’t get the activation email and they’ll try to register again if they really care about using your site. Enterprising individuals will just copy and paste, but what it comes down to is this: if your user enters a bad email address, you shouldn’t make it more of a problem for yourself than you have to.
A complex regex validation on the email address doesn’t introduce an additional solution, it introduces an additional problem.
The syntax for an email address is familiar to most Internet users.