Monday 10 August 2015

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.

  1. <?php
  2. if(isset($_POST['submit']))
  3. {
  4. $email_from = $_POST['email'];
  5. $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  6. if(preg_match($email_exp,$email_from)) {
  7. echo 'The Email Address you entered does not appear to be valid.';
  8. }
  9. else
  10. {

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.

No comments:

Post a Comment