Re: array varible problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux