Answers for "php get first element of iterator class"

PHP
0

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();
Posted by: Guest on February-25-2021

Code answers related to "php get first element of iterator class"

Browse Popular Code Answers by Language