We have ~20000 folders stored on our LAN in a master folder I'll call "folder" these are subdivided into groups of 1000 in folders named 1000-1999, 2000-2999 etc... if a folder exists - say 5416, I want to return a link to it.
My question is:
Originally I was spinning through the items in "folder", if they were a directory, I exploded the current folder name to obtain lower and upper bounds, compared whether the folder I was searching for (5416) fell within the upper and lower bounds of the current folder and checked to see if 5416 existed within it.
I'm not having any performance issues but it occurred to me that maybe exploding the strings and doing the comparisons was more computationally expensive than just using PHP's file_exists.
Thoughts?