Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Percentages in PHP
First of all let me say that, as a student in elementary school I had problems with mathematics.
Secondly, I know very little PHP and what I do know is hacked from other sources.
The problem...
I have 130 people visit my site.
65 of them have made comments.
Now even I know that's 50% of them, but what equation in PHP would I use to work it out?
Secondly, I know very little PHP and what I do know is hacked from other sources.
The problem...
I have 130 people visit my site.
65 of them have made comments.
Now even I know that's 50% of them, but what equation in PHP would I use to work it out?
Posted: Thursday, 3 May 2007 at 1:16PM
0
This discussion has been closed.
Comments
In case anyone else is interested...
<?php $visitors = 130; $commentors = 65; echo 'Visitors: '.$visitors; echo'<br>'; echo 'Commenters: '.$commentors; echo'<br>'; $percy = round(($commentors/$visitors)*100, 0); echo $percy.'% of visitors have made comments'; ?>
Posted: Thursday, 3 May 2007 at 2:07PM