== and === the difference Difference between comparison operators

by rajesh 2009-10-29 09:00:58

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

Tagged in:

817
like
0
dislike
0
mail
flag

You must LOGIN to add comments