note 21206 deleted from control-structures.for by tomsommer
| From: | tomsommer@php.net | Date: | Thu, 05 Aug 2004 18:28:58 +0000 |
| Subject: | note 21206 deleted from control-structures.for by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74071@lists.php.net to get a copy of this message | ||
Note Submitter: heywadup@hotmail.com
----
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.