|
Posted by edwardspl on 08/14/05 12:43
Sorry, I don't quit understanding the site http://www.php.net/for...
So, would you mind to give me a example about it ?
Thank for your help !
Jasper Bryant-Greene wrote:
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
[Back to original message]
|