PHP Tutorials
Php What isPHP INI Tutorials
Php ini What isMuch like the arithmetic operators, logical operators will probably play a major role in many of your PHP applications, providing a way to make decisions based on the values of multiple variables. Logical operators make it possible to direct the flow of a program and are used frequently with control structures, such as the if conditional and the while and for loops.
Logical operators are also commonly used to provide details about the outcome of other operations, particularly those that return a value.
Example | Label | Outcome |
$a && $b | AND | True if both $a and $b are true |
$a AND $b | AND | True if both $a and $b are true |
$a || $b | OR | True if either $a or $b is true |
$a || $b | OR | True if either $a or $b is true |
$a OR $b | OR | True if either $a or $b is true |
!$a | NOT | True if $a is not true |
NOT $a | NOT | True if $a is not true |
$a XOR $b | Exclusive OR | True if only $a or only $b is true |
|
Tweet |
|
|