accessing value of next() and rewind() in a PHP iterator run in a foreach loop

elanspark

New Member
Saw this in wikipedia, this is what happens when you traverse an iterator via a foreach loop:\[quote\] These methods are all being used in a complete foreach( $object as $key=>$value ) sequence. The methods are executed in the following order:\[/quote\]\[code\]rewind() while valid() { current() in $value key() in $key next()} End of Loop\[/code\]I was wondering how I can access the values of next() and rewind(). Any ideas?UPDATE: Access them from inside the foreach loop
 
Back
Top