note 9273 added to each
| From: | kris at angelanthony dot com | Date: | Wed, 25 Oct 2000 17:03:27 +0000 |
| Subject: | note 9273 added to each | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6907@lists.php.net to get a copy of this message | ||
Remember to use "reset()" if you iterate over an array with "each()" more than
once! Example:
while(list($key,$value) = each($array)){
// code here
}
NOW the internal pointer on $array is at the end of the array, and another attempt at an iteration
like the one above will result in zero executions of the code within the "while" block.
You MUST call "reset($array)" to reset the internal array pointer before iterating over
the array again from the first element.
http://www.php.net/manual/function.each.php