Is there a way to write the PHP file_exists function so that it searches a directory for a file with an arbitrary extension. For instance, suppose I knew that a file were c
As long as file_exists returns a BOOLEAN I wrote this small function that accepts a search string with * to look for files... Example:
searchForFile("temp*");
function searchForFile($fileToSearchFor){
$numberOfFiles = count(glob($fileToSearchFor));
if($numberOfFiles == 0){ return(FALSE); } else { return(TRUE);}
}