note 15099 added to control-structures.for
| From: | ben at dailystaple dot com | Date: | Tue, 28 Aug 2001 06:56:41 +0000 |
| Subject: | note 15099 added to control-structures.for | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17239@lists.php.net to get a copy of this message | ||
unlike C++ you can't increment in the same way:
for($i=1; $i <= sizeof($array); $i+2){...} loops infinitely,
you have to say for($i=1; $i <= sizeof($array); $i+=2) {...}
http://www.php.net/manual/en/control-structures.for.php