The PHP language has two comparison operators for testing for equality: the Equal operator (==) and the Identical operator (===). This is necessary because PHP is a loosely-typed language – a variable can be assigned any type that you wish, and does not retain any typing information other than what it is currently holding.
The Equal operator (==) does a loose type comparison, which means that PHP is very liberal about what it considers equal. Some of these work in your favor: TRUE == 1, FALSE == 0, NULL == FALSE etc. Things start to get strange, however: TRUE == ‘FALSE’ for example. Take a look at these charts for some more examples.
The most confusing example that I have run across, however, is one that I encountered at my day job. A client was complaining that data was being imported to the wrong records. After a few minutes of stepping through the import process, I was stupefied that the following conditional returns true: ’1234567890′ == ’123456789E1′. The loose comparison performed by the Equal operator decided that these two strings were numeric, and compared them as such. The one that ends in E1 was assumed to be in scientific notation, which turned the E1 into *10, adding a zero at the end and effectively making the two ‘numbers’ the same. FACEPALM
The Identical operator (===) solves this problem because it checks types as well as value. 0 === FALSE will evaluate to FALSE, since 0 is an integer and FALSE is a boolean. This is a very useful operator – especially considering that some functions can return 0 or FALSE (ex. strpos); both have a different meaning, but comparing with the Equal operator could give you the same result for both.