Re: array varible problems

From: Date: Sun, 14 Aug 2005 05:05:16 +0000
Subject: Re: array varible problems
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-220584@lists.php.net to get a copy of this message
Dan Lowe wrote:
for($i=1;$i<5;$i++)
This means: * Start with $i = 1 * End loop if $i is less than 5 * Increment $i each time around So your loop is ending at the first check because $i is less than 5. You want $i > 4 instead, I think.
Umm, no, I don't think so... Your second point is wrong. The second part of a "for" statement indicates a statement that *must be true for the loop to continue*. I think you need to read this: http://www.php.net/for "In the beginning of each iteration, expr2 is evaluated. If it evaluates to TRUE, the loop continues and the nested statement(s) are executed. If it evaluates to FALSE, the execution of the loop ends." Jasper

« previous php.general (#220584) next »