PHP Program To Demonstrate Logical Operators

PHP Program To Demonstrate Logical Operators

Write PHP program to demonstrate the use of logical operators

<!--Write A Programme To Implement Comparison Operator in PHP -->

<html>
   
   <head>
      <title>Comparison Operators</title>
   </head>
   
   <body>
      
      <?php
         
            $a = 80;
            $b = 50;
 
            // Here var_dump function has been used to
            // display structure
            echo "value of a = 80 <br> value of b = 50<br><br>";
       
            echo "a == b : ";
            echo var_dump($a == $b);
       
            echo "<br>a != b : ";
            echo var_dump($a != $b);
       
            echo "<br>a <> b : ";
            echo var_dump($a <> $b);
       
            echo "<br>a == b : ";
            echo var_dump($a == $b);
       
            echo "<br>a != b : ";
            echo var_dump($a != $b);
       
            echo "<br>a < b : ";
            echo var_dump($a < $b);
       
            echo "<br>a > b : ";
            echo var_dump($a > $b);
       
            echo "<br>a <= b : ";
            echo var_dump($a <= $b);
       
            echo "<br>a >= b : ";
            echo var_dump($a >= $b);

      ?>
      
   </body>
</html>

Output:

value of a = 80
value of b = 50

a == b : bool(false)
a != b : bool(true)
a <> b : bool(true)
a == b : bool(false)
a != b : bool(true)
a < b : bool(false)
a > b : bool(true)
a <= b : bool(false)
a >= b : bool(true)