Calculation in PHP
By S.Tanveer
Published: 14 Jul 2003
Calculation in PHP
How we Calculate Numbers in PHP
The calculation is main part of any programming language. in PHP you can add, subtract , multiply and perform division of number. You can use the basic arithmetic operator + , - , * and / for calculation.
To add the contents of variables, you just separate each variable name with a plus symbol.
for example
You can also calculate the direct values:
echo 10 + 20 + 30 ;
Or even this:
$number = 10;
echo $number + 30 ;
in this example we use * operator which is used for multiplication.