I am using a flow player jquery to show latest 20 hot items, these items will be called directly from database.
The twist is the flow player divs.
One div can carry 5 items, like that I have to add 4 divs.
Each div contains just 5 items from the database, but the problem is how do I split the database equally in those 4 divs.
I tried the following code, but it just displays me the starting 5, How do I display the next 5 in another div and so on…..
$i = 0;
foreach($data as $idx=>$project_name)
{
echo '<div>';
echo $project_name['ProjectImage'];
echo '</div>';
if (++$i == 5) break;
}
And logic that will help me?
in your code BREAK is the only problem… break will stop execution of loop and get you out of the loop.
this code will work fine for you