Thread: PHP Help
View Single Post
Old
  (#4)
BrianG
RC-Monster Admin
 
BrianG's Avatar
 
Offline
Posts: 14,609
Join Date: Nov 2005
Location: Des Moines, IA
02.17.2010, 01:55 PM

Well, the scripts creates an array of all files in one shot ($dimg = opendir($imgdir);), which is really where I think the delay is happening. The script then loops through this array, and if the current file has an extension that matches one in the $allowed_types array, it adds that file to a final array ($a_img[]).

Running a seperate loop for each type would actually take longer. The only thing I could do differently is save the sorting until the loop is finished.

Thanks for the thoughts though!
  Send a message via Yahoo to BrianG Send a message via MSN to BrianG  
Reply With Quote