News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rafael Dohms' Blog:
Iterating over life with SPL Iterators I Directories
October 08, 2009 @ 11:57:33

Rafael Dohms has posted the first part of a series he's writing looking at the Iterators that come with the Standard PHP Library (SPL). In this first article he focuses on Directory iterators.

Wouldn't it be nice if you could go by life just applying a foreach to each year and life day by day? Ok, that was an awful joke, but using iterators does make life a lot easier and fun, and that's without mentioning cleaner code. SPL's iterator classes are really awesome and helpful, replacing multiple lines of code and a handful functions with a simple new this and a foreach can really help cleaning up code.

He looks at both the DirectoryIterator and the RecursiveDirectoryIterator with code examples to go with each.

0 comments voice your opinion now!
spl iterator directory recursive


blog comments powered by Disqus

Similar Posts

Rafael Dohms' Blog: Iterating over life with SPL Iterators I: Directories

Rafael Dohms' Blog: Iterating over life with SPL Iterators I: Directories

Northclick Blog: The real power of PHP stream wrappers

Ibuildings Blog: Implementing Iterators

Secunia.com: CodeIgniter Weakness and Directory Traversal Vulnerability


Community Events





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


community interview conference podcast symfony api language list release deployment framework development tips series threedevsandamaybe bugfix laravel code zendserver introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework