note 14360 added to function.next.php
| From: | brooke at jump dot net | Date: | Fri, 27 Jul 2001 16:49:13 +0000 |
| Subject: | note 14360 added to function.next.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15946@lists.php.net to get a copy of this message | ||
The right way:
// reset array if needed
while (list($key, $value) = each($array)) {
// do stuff
}
That has all the desirable characteristics and none of the undesirable ones. You can also use
list(,$value) if you only care about the values and not the keys.
http://www.php.net/manual/en/function.next.php