note 21206 added to control-structures.for

From: Date: Fri, 03 May 2002 01:39:26 +0000
Subject: note 21206 added to control-structures.for
Groups: php.notes 
Request: Send a blank email to php-notes+get-30111@lists.php.net to get a copy of this message
You can make ids decremental, but it wouldn't be able to start at 0. If it started at 0 it would go into negatives, and it would go on forever as you stated $i would only stop when it was greater than the count of $file. Here's a possible alternative (please forgive me, not really sure exactly what you're aiming for) for ($i=count($file);$i>0;$i--) { ... } That way, $i is equal to the amount of values in $file (let's just say 5), so it would run 5 times, or until $i gets to 0. -- http://www.php.net/manual/en/control-structures.for.php http://master.php.net/manage/user-notes.php?action=edit+21206 http://master.php.net/manage/user-notes.php?action=delete+21206 http://master.php.net/manage/user-notes.php?action=reject+21206

« previous php.notes (#30111) next »