willsherwood
asked on
PHP (Linux) all files beginning with ...
I need to generate a loop to display all images that begin with a given base filename (which will have suffixes of various syntaxes, but the base that i give will be unique for this image grouping purpose). The (foreach?) loop would iterate four times in the below case.
Please help me with the PHP wildcard directory search and ensuing loop to process the files
example directory contents:
thanks!
Please help me with the PHP wildcard directory search and ensuing loop to process the files
example directory contents:
100.jpg
100a.jpg
100b.jpg
100c.jpg
100a.jpg
100b.jpg
100c.jpg
$directory_results_from_wildcard_search =
directory_lookup_wildcard ($path_with_base_filename+"*"+".jpg");
//explode??? line by line???
foreach ($directory_results_from_wildcard_search)
{
i can display image at a time here, i'm okay with this part
}
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
well, comment about large number of files was for numbers from 100000 in folder, 4k shouldn't be a problem.
Of course, you should give it a try, and think of other solution if you encounter "Allowed memory size" error
Of course, you should give it a try, and think of other solution if you encounter "Allowed memory size" error
ASKER
yes works fine, many thanks
ASKER
appreciated
ASKER
this directory in this example has 4000 (!) files.
It's an inherited client site, so we have to live with the situation.
i'll give these a try.