in reply to array looping with foreach

See this subthread about each for arrays (and my relatively trivial implementation).

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.


Caution: Contents may have been coded under pressure.