To subtract two numbers in PHP, you can use the subtraction operator (-) like this:
main.php75 chars5 lines
In this example, the values of $num1
and $num2
are subtracted using the -
operator and assigned to the $result
variable. The value of $result
is then printed to the screen using the echo
statement.
You can substitute the values of $num1
and $num2
with any numerical values you wish to subtract.
gistlibby LogSnag