PHP 8.5.0 Alpha 1 available for testing

Voting

: four minus zero?
(Example: nine)

The Note You're Voting On

kris at angelanthony dot com
24 years ago
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.

<< Back to user notes page

To Top