in reply to array looping with foreach

Both look fine to me, although I think I'd personally lean away from option 1. I like to have as few moving parts as possible, and an index that can potentially de-sync if I throw in loop control constructs (and not hit the increment) worries me. But, I'm bad, so many things worry me.

I was curious to see what I've done in the past, so I took a peek at the script I've been working on this week. Interestingly, I think that this problem of "Tracking the index and the value concurrently" is a "C problem" in my mind. Each place I've had to do it, I've rolled a C-style for loop :).