Looping issue PHP
<p>Here is the code:</p>

<pre><code>$TopFive = array_slice($counts,0,5);    
{
  foreach($TopFive as $key =&gt; $tops)
{


for($i=0; $i&lt;$tops; $i++)
{
  echo "*";
}

$b=0;   
for($a=0; $a&lt;5; $a++)
{
  $b++; 
}

echo "{$b}";        
echo "#:{$key} - {$tops} &lt;br/&gt;";    


                }
            }
</code></pre>

<p>currently, the output looks this:</p>

<pre><code>*********5#:THE - 9 
*****5#:OF - 5 
*****5#:TO - 5 
***5#:AND - 3 
***5#:THEM - 3 
</code></pre>

<p>but what I really want to have is this:</p>

<pre><code>********* #1: THE - 9
***** #2: OF - 5
***** #3: TO - 5
*** #4: AND - 3
*** #5: THEM - 3
</code></pre>

<p>I can't seem to figure out how to arrange the looping. Any ideas? I am very sorry this simple question, I ran out of ideas. I just want the numbers to be from 1-5.</p>

<p>I just want some advice as to how to arrange the looping for the $b so that the counting will be from 1-5, not just 5</p>
