Operator is used to perform operation on variable and values. Logical operators perform logical operation which produce Boolean result i.e. True or False.
Given below the some of the main operators of PHP :
(a< 12 && b> 3) returns true
(x==4 || y==4) returns false
!(x==y) returns true
The below example with output given you a clear idea :
<?php $a=3; $b=21; $c=30; echo !($a=$b) ? "true\n" : "false\n"; echo "<br/>"; echo !($b>$c) ? "true\n" : "false\n"; echo "<br/>"; echo !($c>$a) ? "true\n" : "false\n"; ?>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.