note 69314 added to function.iterator-count
| From: | Ard at osu1 dot php dot net | Date: | Thu, 31 Aug 2006 10:39:26 +0000 |
| Subject: | note 69314 added to function.iterator-count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116536@lists.php.net to get a copy of this message | ||
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/')); ?>
----
Server IP: 66.163.161.117
Probable Submitter: 212.45.32.220 (proxied: 83.247.70.113)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.iterator-count.php
Edit -- https://master.php.net/note/edit/69314
Del: integrated -- https://master.php.net/note/delete/69314/integrated
Del: useless -- https://master.php.net/note/delete/69314/useless
Del: bad code -- https://master.php.net/note/delete/69314/bad+code
Del: spam -- https://master.php.net/note/delete/69314/spam
Del: non-english -- https://master.php.net/note/delete/69314/non-english
Del: in docs -- https://master.php.net/note/delete/69314/in+docs
Del: other reasons-- https://master.php.net/note/delete/69314
Reject -- https://master.php.net/note/reject/69314
Search -- https://master.php.net/manage/user-notes.php