Link to home
Start Free TrialLog in
Avatar of willsherwood
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:
100.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
}

Open in new window


thanks!
ASKER CERTIFIED SOLUTION
Avatar of szewkam
szewkam
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of willsherwood
willsherwood

ASKER

i read in the first reference that there may be a problem with # files.
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.
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
yes works fine,  many thanks
appreciated