|
iterator_countCount the elements in an iterator Description
int iterator_count
( Traversable
$iterator
)
Count the elements in an iterator.
iterator_count is not guaranteed to retain the current
position of the Parameters
Return Values
The number of elements in Examples
Example #1 iterator_count example
<?php The above example will output: int(4) Example #2 iterator_count modifies position
<?php The above example will output: string(3) "one" int(3) NULL Example #3 iterator_count in foreach loops
<?php The above example will output: 0: one (3) |