PHP Operators TLE 9
PHP Operators TLE 9
PHP Arithmetic Operations – used with the numeric values to perform common
arithmetical operations such as addition, subtraction,
multiplication and division
x=y x=y The left operand gets set to the value of the
expression on the right
x += y x=x+y Addition
x -= y x=x-y Subtraction
x *= y x=x*y Multiplication
x /= y x=x/y Division
x %= y x=x%y Modulus
PHP Comparison Operators – used to compare two values (number or string)
>= Greater than or equal to $x >= $y Returns true if $x is greater than or equal
to $y
<= Less than or equal to $x <= $y Returns true if $x is less than or equal to
$y
or Or $x or $y True if either $x or $y is
true
|| Or $x || $y True if either $x or $y is
true
conditions.
When PHP reaches a break keyword, it breaks out of the switch block
The default keyword specifies the code to run if there is no case match
If you want multiple cases to use the same code block, you can specify the
cases
PHP Loops - used to execute the same block of code again and again, as long as
a certain condition is true.