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