Using DirectoryIterator to List Files in PHP
During the days of PHP4, the most common way of showing the files in a directory was like so:
PHP:
However, if your PHP version has now been upgraded to PHP 5, you can take advantage of DirectoryIterator instead. This class (don't get scared) is part of the SPL library that is now bundled within PHP 5.
10 comments May 18th, 2006