Equality operators and congruence operators are both comparison operators and binary operators. The return values are true
and false
.
1. Equality operator (==): Only compare the values on both sides of ==.
<?php $a="幸运女神向我走来"; $b="噩运女神离我远去"; if(0==false) { echo $a."<br>"; }else echo $b."<br>"; //输出结果:幸运女神向我走来 ?>
2. Congruence operator (===): Not only compares the values on both sides of ===, but also compares the data types on both sides of ===.
<?php $a="幸运女神向我走来"; $b="噩运女神离我远去"; if(0===false) { echo $a."<br>"; }else echo $b."<br>"; //输出结果:噩运女神离我远去 ?>
The equality operator and the congruence operator are very similar to similar triangles and congruent triangles in junior high school mathematics. The congruence operator returns true, so the equality operator must also return true. The opposite is not true.
Recommended: php tutorial,php video tutorial
The above is the detailed content of triangle puzzle in php. For more information, please follow other related articles on the PHP Chinese website!