Jump to content

Reading pictures in a folder


cooldude832

Recommended Posts

I'm trying to make a simple way to make a dynamic photo gallery function.  This is my idea:

First have a folder called Pics, in pics is a folder for images of different type (the criteria fun,events,nature) then in there I dump the images sorted by types in there with a basic numbering scheme of 01.jpg,02.jpg,03.jpg,04.jpg.  Anyone got any ideas on a way I can read all the pictures in the subfolders and view them without having to give a count of images?

 

Link to comment
Share on other sites

You can read the names into an array simply by using the glob() function.  When you have a lot of images you probably want to display them a few at a time, rather than all together. Knowing how many you have will be useful for paging through them.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.