I have a php file that searches a directory for a filename wildcard and returns the file names. The problem is, some of these directories I search are massive (10s of 1000s of files) and if the user types in a wildcard i.e. * then it returns everything and my PHP just times out and doesn't output anything. Anyone have any idea around this. My logic is rather simple, the user puts in some input in a textbox i.e. a path like c:\some folder\*.txt and then I create and array using glob($userInput) and then echo all of the file names. Any ideas?