Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- INCREMENT OPERATORS
- ++ $x Pre-Increment Operator Increment $x by one then return result
- $x ++ Post-Increment Operator Return the value of $x and increment of the value of $x
- DECRENT OPERATOR
- -- $x Pre Decrement Operator Decrement $x by one then return result
- $x -- Post Decrement Operator Return the value of $x then decrement
- $x = 10;
- echo ++$x;
- echo $x++ . '<br />';
- echo --$x;
- echo '<br />';
- echo $x-- . '<br />';
- echo $x;
- */
- /* LOGICAL OPERATORS
- Logical operators are used to combine two conditional statements
- AND Returns True if both $x & $y are true
- OR Returns True either $x or $y is true
- XOR Returns True if either $x or $y is true but not both
- && Returns True if both $x & $y are true
- || Returns True either $x or $y is true
- ! True if $x is not true
- */
- $a = true && true;
- var_dump($a);
- $b = true && false;
- var_dump($b);
- $c = false && false;
- var_dump($c);
- $a = true || false;
- var_dump($a);
- $b = true || true;
- var_dump($b);
- $c = false || false;
- var_dump($c);
Advertisement
Add Comment
Please, Sign In to add comment