Selasa, 15 Desember 2009

List files of a Directory in php or List files of a folder from php code

Hi,
You might require this code which lists all files from a specific directory in php. It shows the files from a folder you want.
Even you can specify which files to ignore eg. when showing image you dont want to show thumbs.db file, so you can specify in the code neglect thumbs.db file.
So your code will show all files except thumbs.db 

This is a very basic program, you can extend it to a level you want as per your requirement. If you need some help ask me, if possible definitely i will help.


In the below code there is one array $exclude, in this array you specify the files which you want to ignore in your final output, so it will not be shown. And just modify the if loop.





If you know any other way to do the same then comments are always welcome.
Dont forget to tell your friends about http://programming-in-php.blogspot.com

Tidak ada komentar:

Posting Komentar