title: PHP Count Generated Results From Loop
body: <p>I have this for loop that generates 10 results:</p>
  
  <pre><code>    &lt;?php
  
      include "dbconnect.php";
  
      $table = "SELECT id FROM players ORDER BY RAND()* ( 1 / percentage)";
  
      for ($i = 0; $i &lt; 10; $i++){
  
          $result[0] = mysql_fetch_array(mysql_query($table));
  
          foreach ($result as $winner){
  
              echo $winner[0] . " ";
  
          }
  
      }
  
  
  ?&gt; 
  </code></pre>
  
  <p>It generates a result like:</p>
  
  <pre><code>10 10 11 9 13 11 10 12 8 12
  </code></pre>
  
  <p>My question is how do I count the generation? For the above example it would be:</p>
  
  <pre><code>8's = 1, 9's = 1, 10's = 3, 11's = 2, 12's = 2, 13's = 1.
  </code></pre>
  
  <p>I basically want to count the amount of specific results generated. Sorry if i'm not making much sense. </p>