Auto incrementing number in PHP foreach loop

janilol

New Member
This is the beginning of a php for loop. I would like to edit it so that 'INSERT NUMBER HERE' gets replaced with an incrementing number. Ie. first loop it would be 1, then 2, then 3 etc.\[code\]<?php foreach ($_productCollection as $_product): ?> <div style="float: left; font-size: 120px;height:50px;padding-top:50px; color:#ccc">INSERT NUMBER HERE</div> <div class="listing-item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">\[/code\]How can I achieve this?Thanks
 
Back
Top