Reputation: 35
Here's my code:
foreach($a as $item):
echo '<span>'.$item['idx'].'.</span>';
echo '<a href='.$item['url'].'>'.$item['title'].'</a><br />';
echo '<span>'.$item['description'].'</span><br /><br />';
endforeach;
This is the line I'm specifically having problems with:
echo '<span>'.$item['idx'].'.</span>';
That line will echo a number from my array, but I need to increment that number by one (1).
I've tried doing this several ways such as adding +1
or ++1
and I'm not sure if I'm adding it in the wrong place or if I should be using something totally different increment.
What needs to be done to increment that variable by one each time?
Upvotes: 0
Views: 73