PHP provides three logical operators when we test more than one condition to make decisions. These are: && (meaning logical AND), || (meaning logical OR) and ! (meaning logical NOT).
Operator | Description |
---|---|
&& | And operator performs logical conjunction on two expressions (if both expressions evaluate to True, result is True. If either expression evaluates to False, the result is False) |
|| | Or operator performs a logical disjunction on two expressions (if either or both expressions evaluate to True, the result is True). |
! | Not operator performs logical negation on an expression. |