| |
|
PHP directory listing |
Many times we have to display the list of files in a directory. We can keep the script in any location and by using the file path we can display the files inside the directory. Read the path and the script will take care to list the files inside that. Here is the code.
// open the current directory by opendir $handle=opendir(".");
while (($file = readdir($handle))!==false) { echo "$file <br>"; }
closedir($handle);
| |
| Subscribe |
|
Submit your email address and receive
article and product notifications. Your email is safe with us.
|
|
|
|
|
|