Here is the code:
$TopFive = array_slice($counts,0,5);
{
foreach($TopFive as $key => $tops)
{
for($i=0; $i<$tops; $i++)
{
echo "*";
}
$b=0;
for($a=0; $a<5; $a++)
{
$b++;
}
echo "{$b}";
echo "#:{$key} - {$tops} <br/>";
}
}
currently, the output looks this:
*********5#:THE - 9
*****5#:OF - 5
*****5#:TO - 5
***5#:AND - 3
***5#:THEM - 3
but what I really want to have is this:
********* #1: THE - 9
***** #2: OF - 5
***** #3: TO - 5
*** #4: AND - 3
*** #5: THEM - 3
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.
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
If:
then:
Here’s an example.