Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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();
 
PREVIOUS NEXT
Tagged: #php #element #iterator #class
ADD COMMENT
Topic
Name
4+4 =