Re: array varible problems
| From: | Jasper Bryant-Greene | Date: | Sun, 14 Aug 2005 09:46:20 +0000 |
| Subject: | Re: array varible problems | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220594@lists.php.net to get a copy of this message | ||
edwardspl@ita.org.mo wrote:
Sorry, I don't quit understanding the site http://www.php.net/for... So, would you mind to give me a example about it ?for($i=0; $i<3; $i++) { print($i); } will print: 0 1 2 Basically in any expression like the following: for(expr1; expr2; expr3) { // some code } expr1 is evaluated first. then for as long as expr2 is true, "some code" followed by expr3 will be evaluated over and over. So the example at the start of my message initially sets $i to 0, then repeats the code, adding 1 to $i each time, for as long as $i is less than 3. Jasper