Listing files in a directory with PHP...
Posted by Lucian Daniliuc in
PHP on 05 18th, 2009 |
No Comments
Listing the files in a directory in PHP is as simple as 1 line:
$aList = scandir( '/tmp' );
print_r( $aList );
This will retrieve all the files in the specified directory (including “.” and “..”):
Array
(
[0] => .
[1] => ..
...