PHP most efficient way to list the files in a very large directory

John picture John · Mar 30, 2011 · Viewed 19.5k times · Source

Possible Duplicates:
Get the Files inside a directory
PHP: scandir() is too slow

I have a directory with tens of thousands of files in it and I want to display a list of these files on a page. I tried doing it with scandir and it takes forever. What would be an efficient method of achieving this?

Answer

eisberg picture eisberg · Mar 30, 2011