I want to still use foreach
Why? A C-style for is perfectly acceptable here. That is, so long as you use it correctly. For the example you gave to match your foreach loop, you'd have to change your condition to $i < $foo because your current code, $i <= $foo, will leave you with $i being one more than $foo if you get to the end of your loop.
-sauoq "My two cents aren't worth a dime.";
In reply to Re^2: Last undefines a for loop's itererator?
by sauoq
in thread Last undefines a for loop's itererator?
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |