Hey,
I know basically what I have to do to achieve what I want, but preg_match is so confusing with its search criteria and characters. I want to make a loop that reads all the files in a folder (they are all images) and sort them by their initial filename and the number included.
Each folder will have something like this:
large1.jpg
large2.jpg
large3.jpg
thumb1.jpg
thumb2.jpg
thumb3.jpg
main1.jpg
main2.jpg
main3.jpg
original1.jpg
original2.jpg
original3.jpg
I want to sort it something like “original[0-9].jpg” and either put it in array or whatever so I can count the total (like 3 of each) and use each one. I have the right loop I think for the files, but I don’t know how to do the filename filter. Any help would be appreciated. Thanks.