I need a little help with a foreach loop.
Basically what i need to do is wrap a div around the output of the data every 4 loops.
I have the following loop:
foreach( $users_kicks as $kicks ) {
echo $kicks->brand;
}
For every 4 times it echos that out i want to wrap it in a so at the end it will look like so:
<div>
kicks brand
kicks brand
kicks brand
kicks brand
</div>
<div>
kicks brand
kicks brand
kicks brand
kicks brand
</div>
<div>
kicks brand
kicks brand
kicks brand
kicks brand
</div>
and so on.
Cheers
1 Answer