I basically want to search for a file on my computer. I know how to search but is there a fast way of searching a name and an extension without flooding my script with more than 2 for loops? the names (eg.. file,virus,node,misc) and the extensions will be added dynamically, Not through the source code.. the names will be in the thousands so i dont want to add them one by one, hence why i am doing it dynamically.
i was thinking:
foreach($names as $i){
if (file_exists($i.".exe" | $i.".py" | $i.".js" | $i.".html" | )){
//echo true or false}}
Like i said. I will be adding in extensions dynamically also. Would it be worth it having the code long with file_exists(20 thousand extensions)
or just add them with a form?
Would it be a for loop inside another for loop?