subtracting a percentage from a value in php -
I is typing something similar to the coupon code function, and the set amount of the amount together with the set amount
My code is as follows;
$ amount = "25"; // Discount amount $ percent = "yes"; // Is the coupon (yes) percent, or (any) a flat amount if ($ percent == "yes") {$ newprice = ???????; // Decrease the amount of Dollar value; from $ value; And {$ newprice = $ value - $ amount; // if not a percentage, completely subtract from value}
I'm searching for you to find Google while searching for a solution, but I thought the ID was posted here In addition to helping others, there is also one problem which can be the problem.
How about it?
$ newprice = $ value * (($ 100- $) / 100);
Comments
Post a Comment