Page 1 of 1

Need help! gathering iamges and displaying names

Posted: Tue Jan 31, 2006 5:02 pm
by aLf
I need help!
I need to gather all images from directiory, and then display all pictures one under another
Only needs to show picture and name.jpg under it!


EXAMPLE:

Code: Select all

--------
- IMG1 -
--------
img1.jpg

--------
- IMG2 -
--------
img2.jpg
Hope you got the point!

Thank you in advance!


aLf

Posted: Tue Jan 31, 2006 7:46 pm
by raghavan20
you need PHP, you have to use opendir, readdir and check for extensions...start from here

Posted: Wed Feb 01, 2006 10:13 am
by pickle
glob() might be easier

Code: Select all

<?
glob("/path/to/dir/*{.gif|.jpg|.png}",GLOB_BRACE);
?>
That line *should* get you all the GIF, JPG, and PNG files in that directory. From there it's easy.