note 69314 deleted from function.iterator-count by cmb

From: Date: Mon, 24 Aug 2015 18:16:24 +0000
Subject: note 69314 deleted from function.iterator-count by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-203446@lists.php.net to get a copy of this message
Note Submitter: Ard ---- 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/')); ?>

« previous php.notes (#203446) next »