views:

46

answers:

3

What's the opposite of triple equals matching in PHP?

$mail_01 = filter_var($mail_01, FILTER_VALIDATE_EMAIL);
if($mail !== false){
    echo "Email address required";
}

Is the !== usage correct? Thanks for any help.

+2  A: 

Yes, !== is correct. From the manual:

$a !== $b Not identical
TRUE if $a is not equal to $b, or they are not of the same type. (introduced in PHP 4)

Andy E
+5  A: 

Yes, this is correct. See the PHP manual

Ikke
+1 for the overview
Natrium
Thanks for the link!
Nirmal
+1  A: 

Yes, that's correct. a !== b is logically equivalent to !(a === b).

Rich Adams