PHP: iterator_count - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

iterator_to_array class_parents

Last updated: Fri, 26 Jan 2007

view this page in

# iterator_count

(PHP 5 >= 5.1.0RC1)

iterator_count -- Count the elements in an iterator

## Description

int iterator_count ( IteratorAggregate iterator )

Внимание
К настоящему времени эта функция еще не была документирована; для ознакомления доступен только список аргументов.

add a note User Contributed Notes
iterator_count
Ard
31-Aug-2006 03:39
`Note that you that the iterator parameter doesn't need to be of type Aggregate. As the spl documentation on http://www.php.net/~helly/php/ext/spl/ defines it in the following way:
iterator_count (Traversable $it).
So you can count the number of files in a given directory quite easily:
<?php iterator_count(new DirectoryIterator('path/to/dir/')); ?>`
add a note
iterator_to_array class_parents

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST