PHP: Directory Read
Read the contents of a directory of images. Exclude the non-image directory entries. Create a caption by deleting the file extension and capitalizing the file name.
Choose a directory: Comics • Embroidery • Carving • Tech
![](../images/comics/01_dina.png)
![](../images/comics/02_claire.png)
![](../images/comics/03_dorothy.png)
![](../images/comics/04_dale.png)
![](../images/comics/05_lottie.png)
![](../images/comics/06_marigold.png)
![](../images/comics/07_sonny.png)
![](../images/comics/08_hannelore.png)
![](../images/comics/09_mildred.png)
![](../images/comics/10_walky.png)
![](../images/comics/11_joyce.png)
![](../images/comics/12_shauna.png)
We can change the order of the files (for example, birth order instead of alphabetical order) by prepending each file name with a number and removing the number from the caption string.
Images courtesy of:
Stone Paperweight at World of Judaica
Embroidery Designs at 4-Hobby.com
Dumbing of Age
Scary Go Round
Questionable Content