Snippet Name: List files in directory
Description: Prints out all of the files inside a given directory.
Comment: (none)
Language: PHP
Highlight Mode: PHP
Last Modified: March 01st, 2009
|
<?PHP
IF ($handle = OPENDIR('/system/path/to/files')) {
ECHO "Files:\n";
// list out the files
WHILE (FALSE !== ($file = READDIR($handle))) {
ECHO "$file\n";
}
CLOSEDIR($handle);
}
?> |