PHP |
Values |
Operators |
Functions |
Arrays |
Forms |
Sessions-Cookies |
Classes
Operators are symbols that modify values. The . concatenation operator connects strings and variables in sequence. This is an alternative method to quotes within quotes management and multiple echo statements. The concatenation operator is different than a period used in a string...
The output is...
I am a tree and I am 100 years old.
Double quotes allow variable substitution...
The output is...
I am a tree and I am 100 years old.
These are arithmetic operators...
+ add
- subtract
* multiply
/ divide
% remainder
++ increment
-- decrement
Operators can be combined. An operator followed with the = means to apply that operator to the variable...
The output is...
15
This is another example of combining operators...
The output is...
A bird, or two, or three, or four.
The ++ increment operator increases one numeric value...
The output is...
10
The -- decrement operator decreases one numeric value. This example combines the operator and variable...
The output is...
11
An evaluation within ( ) parenthesis takes precedence in a statement...
The output is...
81
These are comparison operators...
<= less than or equal to
>= greater than or equal to
!= not equal to
== equal to
These are logical operators...
&& and
|| or
! not