(PHP 5 >= 5.1.0)
iterator_count — Count the elements in an iterator
iterator
The iterator being counted.
The number of elements in iterator
.
Example #1 iterator_count() example
<?php
$iterator = new ArrayIterator(array('recipe'=>'pancakes', 'egg', 'milk', 'flour'));
var_dump(iterator_count($iterator));
?>
Exemplul de mai sus va afișa:
int(4)