SPL 함수 목록
PHP Manual

iterator_count

(PHP 5 >= 5.1.0)

iterator_countCount the elements in an iterator

설명

int iterator_count ( Traversable $iterator )

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));
?>

위 예제의 출력:

int(4)


SPL 함수 목록
PHP Manual