Home >Backend Development >PHP Tutorial >triangle puzzle in php

triangle puzzle in php

autoload
autoloadOriginal
2021-03-05 16:39:182879browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn