Email addresses: easy to create, difficult to type. Note that FILTER_VALIDATE_EMAIL will validate email addresses that contain domains and top-level domains that do not exist.

validating email in php-88

How many times have you heard of email being termed "the ultimate killer application"?

Indeed, the impact that it has made on all of our lives in such a short period of time is immeasurable.

Not taking the time to properly verify user input in this regards is a detriment to not only the organization, but also the user who has shelled out time and perhaps money for your service!

In this article, I'll show you how to use the PHP scripting language to aid in the validation of email addresses on not only the level of syntactical correctness, but also of actual existence on the destination domain!

Note: You can make web forms quickly with Simfatic Forms.

Simfatic Forms helps you to make complete, feature rich web forms and get it online quickly. This generic PHP form validator script makes it very easy to add validations to your form.

These easily implementable procedures will go a very long way towards eliminating future asdf's, blah's, and other invalid entries from your user database.

As a byproduct, you'll also learn a bit more about regular expressions, and PHP's regular expression and networking functions.

The first argument is the name of the input field in the form.

The second argument is the validation descriptor that tells the type of the validation required.

For example, “req” means required, “alpha” means allow only alphabetic characters and so on.