News Feed
Sections




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

PHPMaster.com:
List Files and Directories with PHP
October 23, 2012 @ 08:56:25

On PHPMaster.com there's a new tutorial showing you how to work with files and directories through your PHP applications.

In this article I'll talk about a common task you might have experienced while developing a PHP application: listing files and directories. I'll discuss several basic and advanced solutions, each having its pros and cons. First I'll present three approaches that use some very basic PHP functions and then progress to more robust ones which make use of SPL Iterators.

The solutions they look at are the built-in functions like glob and readdir/opendir as well as SPL iterators up for the task - FilesystemIterator, RecursiveDirectoryIterator and GlobIterator. Code samples are included in the post, showing how to use each method to get and list the files. A few helpful hints are also included to finish off the tutorial (mostly about "tricks" to using the functions effectively).

0 comments voice your opinion now!
tutorial file directory list spl iterator


blog comments powered by Disqus

Similar Posts

Noupe.com: 20 Useful PHP + jQuery Components & Tuts for Everyday Project

DevShed: Integrate Facebook Comments Code with Wordpress or PHP

HowTo Forge: Installing Lighttpd With PHP5 And MySQL Support On Mandriva 2008.0

Dutch Web Alliance: The definitive remote debug and unittest with PHPStorm guide: part 5

IBM developerWorks: Cook up Web sites fast w/CakePHP, Part 1: Adding related information & services


Community Events





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


update release package library introduction list api opinion language zendserver laravel podcast tips series framework symfony community install interview deployment

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