Tuesday, March 5, 2024

PHP logical operators

   PHP logical operators 

PHP logical operators



Logical Operators:

  • AND (&& or and)
  • OR (|| or or)
  • NOT (! or not)
  • XOR (exclusive OR) (xor)

 PHP logical operators 

Example :-


<?php
$a=10;
$b=5;
$c=20;
$d=20;
var_dump(($a<$c)&&($c==$d)&&($b<$c));//true
var_dump(!(($a<$c)&&($c==$d)&&($b<$c)));//false
var_dump(($a>$d)||($b<$c));//true
?>

 logical operators php

Output

logical operators php/output









READ MORE

No comments:

Post a Comment