I have 2 variables: $vatRate and $priceExVat. I want to create another variable named $endPrice which adds the VAT on. I have no clue on how to do this, and am a begginner at PHP so I would like to have a code example 😉
$priceExVat == $_POST['priceExVat'];
$vatRate = $_POST['vatRate'];
rtrim($vatRate ,'%');
$endPrice = ($vatRate * $priceExVat) + $priceExVat;
echo $endPrice;
EDIT: Above is the non-working code which returns a 0
or
Example
Since getting -3
All the answer is somehow wrong if the value is string 20%