Find files (photos*.jpg) - (req: glob replacement)
Posted: Fri Jun 20, 2003 4:10 pm
Hi guys,
I'm having some problem creating a php function
that searches a specific path for for files that match the patern
"photos*.jpg" or "pics_?.gif". If the files are found I would like
the results to be returned to an array.
Here is the break down
BTW. I cannot use the glob because the server is running PHP 4.2.2
I currently working on a realestate website and I need to check if a photo(s)
exists for a property (house, busnisess, etc..). The photo name coresponds to the propety id. for example if the property id
number = 50123, then the filename for that photo would be "50123.jpg". However there are some properties that have more than one photos so for the secon photo the filename would be something like "50123_2.jpg" and the 3rd would be "50123_3.jpg" and so on.
so now, given the directory with the images I have to check if a photo exist for
a selected property and also I need to check if there are more images for that property.
Thanks
I'm having some problem creating a php function
that searches a specific path for for files that match the patern
"photos*.jpg" or "pics_?.gif". If the files are found I would like
the results to be returned to an array.
Here is the break down
BTW. I cannot use the glob because the server is running PHP 4.2.2
I currently working on a realestate website and I need to check if a photo(s)
exists for a property (house, busnisess, etc..). The photo name coresponds to the propety id. for example if the property id
number = 50123, then the filename for that photo would be "50123.jpg". However there are some properties that have more than one photos so for the secon photo the filename would be something like "50123_2.jpg" and the 3rd would be "50123_3.jpg" and so on.
so now, given the directory with the images I have to check if a photo exist for
a selected property and also I need to check if there are more images for that property.
Thanks