Summary
Use PHP to retrieve image files from a directory and display them without knowing what the image file names are. This builds on the getimagesize() function I demo’d before.
I’m doing this so I can place images in a directory from which I can pull out to display in a slideshow on the home page and maybe the Archives section.
The demo here is only for a more procedural method to do it; for practicality’s sake, I would merge the two steps into one and probably put all of it into a function so I can retrieve an array of image file names just by providing the directory I want the server to look in.
What I Learned
If the web page is not in the same directory of the images, the opendir(), filetype(), and getimagesize() functions take the address of the directory in the parameter with $_SERVER['DOCUMENT_ROOT'] and then the directory from your domain, and not the uri’s (which start with “http://”).