News Feed

News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way
How do I...recursively scan directories with PHP's DirectoryIterators?
June 18, 2008 @ 07:55:21 has a new tutorial posted today talking about the use if Iterators (from PHP's SPL) to recurse down through directories on your local drive.

One of PHP5's most interesting new features is the addition of Iterators, a collection of ready-made interfaces designed to help in navigating and processing hierarchical data structures. These Iterators significantly reduce the amount of code required to process an XML document tree or a file collection.

They give three examples - two basic ones showing a simple use of the DirectoryIterator and RecursiveDirectoryIterator and another slightly more complex one showing how to get information from the recursive iteration as it goes down.

0 comments voice your opinion now!
directoryiterator iterator recursive directory example

blog comments powered by Disqus

Similar Posts

Terry Chay's Blog: Clever HTTP

Zend Developer Zone: Accessing DB2 Data Inside of i5/OS

PHPImpact Blog: From Swift Mailer to Zend_Mail

Timothy Boronczyk's Blog: Evil Access (a Database Class)

Rob Allen: Thoughts on module directory structure

Community Events

Don't see your event here?
Let us know!

api library community release opinion laravel php7 series voicesoftheelephpant podcast extension version interview unittest introduction wordpress laravel5 example framework language

All content copyright, 2015 :: - Powered by the Solar PHP Framework