Quick Search:
 
 PHP Code: List files in directory Jump to:  
Category: >> PHP Code >> List files in directory  

<< lastnext >>

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); 
} 
 
?> 


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org