Validating an email address in php

Actually you need a valid email address all the time, but sometimes an additional check is necessary to reach your goals.

We use a second layer of email address validation for: Mailboxlayer is a service from apilayer, a company based in Vienna, Austria.

Check the “pattern” attribute where a regular expression is used to validate the form field value.

And of course you can use HTML5 also to set a required field.

This might be enough for smaller sites, but only if you submit only those addresses with a “good” email address format. Besides a check on the email address format, Mailboxlayer is using different methods to check your submitted email address: There are different ways to check the email address format.

This way only the “good” formatted email addresses need to be processed by your PHP function.

If you don’t like to use Java Script for the client side validation, it’s also a good idea to use HTML5 form field validation.

Beside PHP we use a lot of j Query code for our website projects.

Using the following Java Script (j Query) code you can check an email address without a page reload.

Search for validating an email address in php:

validating an email address in php-67validating an email address in php-62

If you enter “[email protected]”, the response shows the suggestion “[email protected]” as a possible valid email address.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “validating an email address in php”

  1. 0);function Jh(a) ;function Uh() C(Uh,vh); Uh.prototype[th]=! 1,gi=new $h;function hi() ;function ii(a) ;function ji(a) function li() li.prototype.reset=function();var mi=new Vh(function(),function(a));function ni(a,b,c) function oi(a) ji.prototype.then=function(a,b,c);ji.prototype.$goog_Thenable=!