| + Addition
- Subtraction
* Multiplication
/ Division
% Modulus (returns the remainder between two numbers)
For example: math.php
|
<html> <head> <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 a number), max (maximum), and min (minimum).
|