![]() |
The iterator_count() function is an inbuilt function in PHP that is used to count the number of elements in an iterator. An iterator is an object that is a collection of elements. Syntax: iterator_count(Traversable $iterator) : int Parameters: This function accepts only one parameter which is described below.
Return Value: The iterator_count() function returns the number of elements in the iterator if this function successfully executes. Program 1: The following program demonstrates the iterator_count() function. PHP
Output
Total elements in the iterator: 5 Program 2: The following program demonstrates the iterator_count() function. PHP
Output
Total number of characters in the string: 13 Reference: https://www.php.net/manual/en/function.iterator-count.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |