RE: [PHP] For Loops and Variables??

2003-09-16 Thread Chris W. Parker
John Ryan mailto:[EMAIL PROTECTED] on Saturday, September 13, 2003 9:26 AM said: When I use for loops, at the start of each iteration, the variables hold the values from the last loop. You're doing it wrong then (I think). 1. You should always initialize your loop counters. i.e. $x = 0;

RE: [PHP] For Loops and Variables??

2003-09-16 Thread Chris W. Parker
Chris W. Parker on Tuesday, September 16, 2003 4:07 PM said: This Is Good(tm): for($x=0;$x100;$x++) { for($x=0;$x100;$x++) { echo Me happy now!!; } } Hehe... whoops! Should be: for($x=0;$x100;$x++) { for($y=0;$y100;$y++) {

[PHP] For Loops and Variables??

2003-09-13 Thread John Ryan
When I use for loops, at the start of each iteration, the variables hold the values from the last loop. First, is there an elegant way of clearing variables at the start of each loop rather than using unset???! It just seems wrong. Also, all my problems would be solved if variables in a for loop

Re: [PHP] For Loops and Variables??

2003-09-13 Thread Curt Zirzow
* Thus wrote John Ryan ([EMAIL PROTECTED]): When I use for loops, at the start of each iteration, the variables hold the values from the last loop. First, is there an elegant way of clearing variables at the start of each loop rather than using unset???! It just seems wrong. I'm unclear as