Friday, 27 November 2015

35_LIST_FILES_IN_PHP

LIST FILES IN PHP


Listing a file is very useful while doing the operation related to images, OR let’s says you want to find a image from a specific folder. So we are going to use two functions one is open directory and second is read directory.



So above program say that we are interested to find the folder/directory “file”.



Check it out in above output my “file” directory contains four text file, and I want to display each text file name using the loop.



However you can also see “.” And “..” in our output. This is just shows me no more directory structure.
“.” :- Means Current Directory
“..”:- Back a Directory
But during the output we don’t want Single and double “.”. So we need to add some of the condition in our code.




No comments:

Post a Comment