PHP check a string is an email address format

With PHP v5.2.0 or greater, you may use regular expressions.

    if(filter_var("", FILTER_VALIDATE_EMAIL)) {
        // valid address, do something
    else {
        // invalid address, do something

By Keenlio, July 29, 2014

What do you think?

Leave a Reply

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

seven + = 8

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>