I have a sorted array in descending order such as with values 100 , 98, 96, 90 ....
and I am using foreach() loop to iterate over the array and use if condition with limit 3 such as `
foreach($array as $arr){
if(loop_counter<3)
{
echo 'something';
}}
to get top 3 positions. but the problem is that if there exist two same values such as 100 , 98, 98, 96, 90 . . then limits should increase from 3 to 4 so that on position 2 there exist two values 98, 98 and position 3 contain value 90 instead of 2nd 98.
thanks in advance