== and === the difference Difference between comparison operators - PHP Views : 390
Tagged in : PHP
0 0
Send mail
Difference Between Comparison Operators == (double equals) and === (triple equals):

Even after programming for years in php many people would still be unclear of the difference between the Comparison Operators == (double equals) and === (triple equals)

== : double equals compares between two values
so

1 == 1 is TRUE
1 == "1" is also TRUE


=== : triple equals compares between values and also their data type
so

1 === 1 is TRUE
1 === "1" is FALSE

By rajesh, On - 2009-10-29



    Login to add Comments .