php get first element of iterator class code example
Example: php get first element of iterator class
$first = $iterator->current();
// remember to rewind it after a foreach
foreach($iterator as $it)
{ /* ... */ }
$iterator->rewind();
$first = $iterator->current();