in reply to array looping with foreach
The ways you've listed are pretty standard for using for, with the second being somewhat preferred, IMO.
Update: if you use method #1, put the increment in a continue block.