How to do Email validation in Php

Hello Reader’s today we will discuss about “Email validation in Php”. The below code tells that how to check your email is valid or not. For this we use regular expression for validate email.

<?phpif(isset($_POST[‘submit’]))

{

$email_from = $_POST[’email’];

$email_exp = ‘/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/’;

if(preg_match($email_exp,$email_from)) {

echo ‘The Email Address you entered does not appear to be valid.’;

}

else

{

How to do Email validation in Php
– Read the full set of codes at How to do Email validation in Php FindNerd’s Blog.

FindNerd is an effective C, Java, Android, Html, iOS, JavaScript, PHP question and Answers,to instantly resolve your various language queries.



Apart from this, If you have any html language issue, you can post at HTML Help Forum and get instantly resolved it from highly experienced FindNerd community members.

Advertisements
How to do Email validation in Php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s