Note: using count on a array object will include non filtered objects. Using iterator_count will not include filtered objects.
(PHP 5 >= 5.1.0)
iterator_count — شمارش جز در تکرار شونده
تکرار شونده مشمول شمارش.
تعداد اجزا در iterator.
Example #1 مثال iterator_count()
<?php
$iterator = new ArrayIterator(array('recipe'=>'pancakes', 'egg', 'milk', 'flour'));
var_dump(iterator_count($iterator));
?>
The above example will output:
int(4)
Note: using count on a array object will include non filtered objects. Using iterator_count will not include filtered objects.