in reply to Re: Last undefines a for loop's itererator?
in thread Last undefines a for loop's itererator?
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.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Last undefines a for loop's itererator?
by kaif (Friar) on Nov 13, 2005 at 23:23 UTC | |
by Aristotle (Chancellor) on Nov 14, 2005 at 00:22 UTC |