Canman2005 Posted March 31, 2007 Share Posted March 31, 2007 Hi all I have the following varibles <? $percent = 20; $total = 200; ?> Basically $percent is the percentage, such as 20% The total is the amount, such as 200 How can I deduct in php $percent from $total, so it would remove 20% from 200? Is this easy? Thanks in advance Dave Quote Link to comment Share on other sites More sharing options...
shocker-z Posted March 31, 2007 Share Posted March 31, 2007 <?php $percent = 20; $total = 200; $tmppercent=100-$percent; $equals=($total / 100 * $tmppercent); echo $equals; ?> This should do the trick for you Regards Liam Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.