Hi,
I am working on a bit of code that will read in a directory of images and display the images in a gallery type view. This would be very useful when hundreds of images are involved as the images names are read in and automatically displayed.
What it is currently doing is reading in the filenames from a directory and sticking those names in an array and then the foreach is going throught each array item and display the thumbnail image with a link to the full size version of that image.
Currently my code is looking like this (I have pasted the code into an HTML file to make it easier to look at):
http://xavier.computing.dundee.ac.uk/smajeed/galleryarray.html
What I want to be able to do is somehow limit the array so that if for example the $page variable was set to 1 then it would do the loop for the images held in the first 20 elements and if $page is set to 2 then it does 21-40 and so on so that the page displays 20 images at any time.
I have tried searching on google and php.net for a way to limit this somehow but cant find anything.
Any help will be much appreciated.
Thank You
Shahbaz