Open your PHP template and save it as phparithmetic.php.
You already saw one example of arithmetic so you may realise that you can take a value, do something mathematical to it and store the answer in a variable. Here is another example which you should paste inside the PHP tag:
$firstvalue=4;
$secondvalue=7;
$answer=$firstvalue+$secondvalue;
echo "<p>The answer is {$answer}</p>";
Upload and try. Then replace the + operator with at least one of these to try:
- -
- / (divide)
- * (multiply)
- ** (exponentiation - to the power of - although you might need to use pow() instead in older versions of the PHP server)