PHP calculate tax function
Posted on 2009-05-05
I have been having trouble writing a PHP function to calculate tax on an amount using an if statement.
My variables come into my page in this format. I cannot modify this and my final total must have the variable name paymentAmount
The following pseudo code explains what I am trying to accomplish, but cant get the syntax correct.
If SHIPTOSTATE is equal to CA then
Subtact SHIPPINGAMT from paymentAmount multiply that total by 0.095 then add SHIPPINGAMT back to that total