I’ve always used JavaScript to validate e-mail addresses. However, it’s best not to rely solely on JavaScript for such things due to accessibility issues. For this reason I’ve begun using PHP for e-mail validation. While I’m quite adept at creating functions for various other (simpler) aspects of form validation, verifying the validity of an e-mail address submitted by a user is a little too much for my pea size brain to cope with. Having scoured the web quite comprehensively, the following is by far the most effective solution I’ve found so far:
http://www.linuxjournal.com/article/9585
It’s not exactly a one-line solution but it certainly does the trick better than anything else I’ve found. It’s also pretty easy to understand and, if you so wish, edit. I hope you find it useful!
Tags: email, PHP, validation



































































Leave a Reply