Apr 292010
Strict comparison in PHP
Answer:
PHP has two ways to compare two variables, type-safe and type-less, e.g.
Type-safe
print ( "123" === "123" ); // print 1
print ( 123 === 123 ); // print 1
print ( 123 === "123" ); // print nothing
Type-less
print ( "123" == "123" ); // print 1
print ( 123 == 123 ); // print 1
print ( 123 == "123" ); // print 1
Reference: http://php.net/manual/en/language.operators.comparison.php