Let's start with an example:
For example, you'll get a function that returns these kinds of situations:
1, more than 0 of the number
2, less than 0 of the number
3, equals 0 of the number (that is, 0)
4, False (On Failure)
At this time if you want to capture the failure, you must use = = = And not use = =
because = = In addition to match the 4th case, will also match the 3rd case, because 0 is also false!
The three equals sign represents the same type of comparison object. A two equal sign means that the condition is satisfied as long as the value is equal.
To add some more:
$a = ' 2 ';//character 2
$b =2;//Numerical Model 2
$a = = $b, it's right, it's all 2.
$a = = = $b, is wrong, because $ A is a character $b is numeric, the value is the same, but the type is different.
There is the "linvo1986-level six" said the kind of "0".
http://www.bkjia.com/PHPjc/328150.html www.bkjia.com true http://www.bkjia.com/PHPjc/328150.html techarticle Let me give you an example: if you have a function that returns these cases: 1, greater than 0, 2, less than 0, 3, 0, 0, False (when failed) .