Rss Feed
  1. Php email validation!!

    Tuesday, 6 November 2012

    <?php
    $email_a = 'joe@example.com';
    if (filter_var($email_a, FILTER_VALIDATE_EMAIL)) {
        echo "This (email_a) email address is considered valid.";
    }

    ?>



    Using regular expression

    <?php
    ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]",
         $email);
    ?>

  2. 0 comments:

    Post a Comment