Cetanu Posted August 14, 2009 Share Posted August 14, 2009 How exactly can I display the images in a directory? I would like to format them so that they appear orderly as well, thanks. Link to comment https://forums.phpfreaks.com/topic/170197-display-directory-contents/ Share on other sites More sharing options...
kratsg Posted August 14, 2009 Share Posted August 14, 2009 <?php <?php $images = array_merge(glob("*.gif"),glob("*.jpg"),glob("*.png"));//create giant array of all images in a directory using glob foreach ($images as $filename) { echo "<img src='$filename' /><br>"."\n"; } ?> Just off the top of my head, I dun think you could use glob to select multiple file types as if it was regex: glob("*.(jpg|gif|png)"); Link to comment https://forums.phpfreaks.com/topic/170197-display-directory-contents/#findComment-897815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.