I'm building an html page that I'd like to add a php loop to.
At present the code looks like this:
<?php $i = 0; ?>
<div class="element-item <?php echo mysql_result($value, $i);?>">...</div>
<?php $i = $i+1; ?>
<div class="element-item <?php echo mysql_result($value, $i);?>">...</div>
<?php $i = $i+1; ?>
<div class="element-item <?php echo mysql_result($value, $i);?>">...</div>
However as every div is exactly the same, apart from ($value, $i) with $i rising in value by 1 each time, I'd like a way of declaring upfront that the loop will contain x amount of divs (in this case 3 but in reality over 100) and that each time it repeats itself $i rises by +1
All help greatly appreciated...