Hi guys, I have an asp page with some products. the prices are without VAT in my database. with the script below the VAT is added inside the page. it's working fine with ASP but i want to convert this to PHP for another web site. can you help me? my asp script: Price without VAT: <% =formatnumber(RS("price"),2) %> € <br /> + VAT 19%: <% vat=RS("price")*0.19 %> <%= formatnumber(vat,2) %> € <br /> Price with VAT = <%final=cdbl(fpa)+cdbl(RS("price"))%><%= formatnumber(final,2) %> € PHP: thanks in advance.
Well you either write your own VAT function, or show us the ASP functions you are using so we can convert them FYI to add VAT @ 19% you do this: function AddVAT($number, $vat) { $multiplier = 1 + ($vat / 100); return round(($number * $multiplier), 2); } //Usage, add 19% VAT to £100 echo AddVat(100,19); Code (markup):
The function you put in the beginning of your script. The echo you put where you want the price including VAT to be displayed. To learn more about PHP: http://www.google.com/search?source=ig&hl=en&rlz=&q=php+tutorial&btnG=Google+Search http://www.php.net/manual/en/