i want to write a page that will traverse a specified directory.... and get all the files in that directory...
in my case the directory will only contain images and display the images with their links...
something like this
How to Do it
p.s. the directory will not be user input.. it will be same directory always...
You could as others have suggested check every file in the dir, or you could use glob to identify files based on extension.
I use something along the lines of:
source: phpacademy.org
// Open a known directory, and proceed to read its contents
For further reference :http://php.net/manual/en/function.opendir.php