LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   php - find files (photo*.jpg) and return results to an array (https://www.linuxquestions.org/questions/programming-9/php-find-files-photo%2A-jpg-and-return-results-to-an-array-66747/)

omarswan 06-19-2003 08:34 PM

php - find files (photo*.jpg) and return results to an array
 
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

Thanks!.

Unseen 06-20-2003 10:28 AM

What specific problem are you having?

Have you tried the readdir($directory_path_goes_here) function?

omarswan 06-20-2003 11:42 AM

Hi Unseen,
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.

Thaks alot for your help


All times are GMT -5. The time now is 12:58 AM.