Hi, Im learning php, but Im a bit confused on this basic problem.
I have the following code:
<?php
include "tax.php";
$price = 95;
echo "Price before tax: $price <br>";
echo "Price after tax: ";
echo add_tax ($price);
?>
Which uses the function below
<?php
function add_tax ($amount) {
$total = $amount * 1.09;
return $total;
}
?>
When I execute the code I can see that it does work, but I do not understand why this part works!
echo add_tax ($price);
There is no multiplier symbol here, so is the function performed on the ($price) variable simply because of where it is located on this line of code? Thanks