Ok I have an array called $numrows[] which has the following values:
1 1 1 1 1 3 6
I am trying to count the number of identical numbers and store it into another array called $numtextboxentered[].
Here is part of my code:
for ($i=0; $i<=count($numrows);$i++)
{
if ($numrows[$i] == $numrows[$i+1])
{$counter++;
}
else
if ($numrows[$i] != $numrows[$i+1])
{
$numtextboxentered[] = $counter;
$counter = 1;
}
}
The values that I should have in $numtextboxentered are: 5 1 1 but I'm not getting that...I am getting 4 0 0
I'm not sure how to fix this code, could someone help me PLEASE ? Thanks!