I want to loop extra deetails.. by calculate the total items divided five. For example, i have 2 items, then i will add extra 3 div to it. When i have 8 items, i will add extra 2 div to it.
$totalcount = 2;
$check = $totalcount %5;
$totalcount = 8;
$check = $totalcount %5;
I found out i cant use this method because it loops wrongly. i will use extra loop to show the result when detect the main loop when reached end of loop.
if($key == $len - 1)
for ($i = 0; $i < $check; $i++) {
// do something
}
}
Is there any solution, i can ensure $totalcount%5
is always equal to zero and add extra div details to it?