iterator_count

PHP 5 >= 5.1.0, PHP 7, PHP 8
iterator_count - Count the elements in an iterator
Manual
Code Examples

Example #1 iterator_count modifies position

Result: string(3) "one" int(3) NULL
PHP Version:

Example #2 iterator_count example

Result: int(4)
PHP Version:

Example #3 iterator_count in foreach loops

Result: 0: one (3)
PHP Version:


Function iterator_count:

Standard PHP Library (SPL) Functions

Most used PHP functions