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









Related Post :-

registration form

php program to print heart star pattern

html button tag

Comments

Popular posts from this blog

What Is CSS Text Color in 2026

CSS Padding Property Explained

CSS Outline Color Property in 2026