Math is fairly easy with PHP. You are already familiar with the most common math operators:
+ Addition
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>math.php</title>
</head>
<body>
<?php
$additionanswer = 100+10;
//Online Calculator
Print("<h1> Online Calculator </h1>");
//Display math output
print("100 + 10 = ". (100 +10). "Addition <br>");
print("100 - 10 = ". (100-10) ." Subtraction <br>");
print("100 * 10 = ". (100*10) ." Multiplication <br>");
print("100/10 = ". (100/10) ." Division <br>");
print("99 % 10 = ". (99%10) ." Modulus (the remainder!) <br>");
?>
</body>
</html>
In addition to the main math operators, there are also many math functions to use, including abs (absolute value), is_nan (is not a number), max (maximum), and min (minimum).