jwilson122 Posted February 4, 2011 Share Posted February 4, 2011 Hey, I have a question about doing a % in PHP.. So say a user in my database has a cash amount of $20.00. Their referrer is going to get 20% of that. How would I calculate that in PHP? Quote Link to comment https://forums.phpfreaks.com/topic/226711-percent/ Share on other sites More sharing options...
drisate Posted February 4, 2011 Share Posted February 4, 2011 $ref_amt = $member_amt / 100 * 20; Quote Link to comment https://forums.phpfreaks.com/topic/226711-percent/#findComment-1169970 Share on other sites More sharing options...
Pikachu2000 Posted February 4, 2011 Share Posted February 4, 2011 20% would be amount * .2 Quote Link to comment https://forums.phpfreaks.com/topic/226711-percent/#findComment-1169971 Share on other sites More sharing options...
jwilson122 Posted February 4, 2011 Author Share Posted February 4, 2011 Thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/226711-percent/#findComment-1169993 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.