echo very 9th item of array a different code
Permalink
HI I have been trying to get my code to output a different script for every 9th item in an array, but i keep going in circles, to make it really simple please see below what i'm trying to do:
So ideally i end up with banks of 8 images in each li. I know it'll be a simple thing for someone, but i'm totally stumped!
Thanks in advance.
Ben
<ul class="sliderlogos"> <li> <?php foreach($customers as $customer){ ?> <?php $image = File::getByID($customer['image_id']); ?><?php echo $ih->outputThumbnail($image, 100, 50);?> <!-- OUTPUT THIS FOR 1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,19... ETC... --> <?php } ?> <?php foreach($customers as $customer){ ?> </li> <li> <?php $image = File::getByID($customer['image_id']); ?><?php echo $ih->outputThumbnail($image, 100, 50);?> <!-- OUTPUT THIS FOR 9,18,27... ETC... --> <?php } ?> </li> </ul>
So ideally i end up with banks of 8 images in each li. I know it'll be a simple thing for someone, but i'm totally stumped!
Thanks in advance.
Ben
Rony