Skip to content

Instantly share code, notes, and snippets.

@vimishor
Created May 6, 2013 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vimishor/5525310 to your computer and use it in GitHub Desktop.
Save vimishor/5525310 to your computer and use it in GitHub Desktop.
Problema #2

Există greșeli în următorul cod ?

function valid_email($email) {
    //Regular expression string to evaluate the email
    $regex = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/';

    //Checks for a match to the expression
    if (preg_match($regex, $email)) {
                //Check for valid domain(helps avoid eronious emails)
                list($username, $domain) = split("@", $email);
                return getmxrr($domain, $mxrecords);
    } else { 
         return false;
    } 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment