user2467899
user2467899

Reputation: 575

Alternative to filter_var($email, FILTER_VALIDATE_EMAIL)

Is there an alternative to filter_var($email, FILTER_VALIDATE_EMAIL)?

Because it doesn't seem to recognize cases such us american@hotmail (without .com for instance) as invalid address.

MY CODE:

$c = 0;
$email = $_POST["ml"];
if(!filter_var($email, FILTER_VALIDATE_EMAIL)){
   $c = 1; // Email non valida
}

Upvotes: 0

Views: 648

Answers (1)

Blackhole
Blackhole

Reputation: 20401

You've probably made something wrong, because it does recognize such adress as invalid. Just try by yourself.

Upvotes: 2

Related Questions