Forum Moderators: coopster
To give an example, say the photos I am trying to match will all start with "photo2" It will be followed by a single lower case letter, and then end in jpg. The directory contains these photos:
photo1a.jpg
photo1b.jpg
photo1c.jpg
photo2a.jpg
photo2b.jpg
photo3a.jpg
photo3b.jpg
photo3c.jpg
How do I get photo2a.jpg and photo2b.jpg to come up, but none of the others? ("photo2" will actually be a variable that comes from a mysql query, if that makes any difference.) I've been trying variations using $photoname [a-z] .jpg with eregi to match the pattern, but nothing I've tried so far has worked.
Thank you SO much for any help with this.
Jennifer
I ended up using fnmatch instead, and that worked like a charm (could have sworn that I tried it once already, but I guess not). Anyway, if anyone can explain why it worked while eregi didn't, an explanation would be great, but I did get the page to do what I wanted.
Jennifer
It should work both ways as long as it is done correctly.
Anyway, the most important thing is that you found the solution :)