So you basically want to search a folder for text inside the files? This could get very, very, very expensive, but one method might be using [man]glob/man to get a list of files in that directory, loop through that array, open each file (array item), search that file for string entered, add to a $matches array if found, continue on to next file in array.
A better option, of course, would be to store the content in a database (such as MySQL) and use fulltext searching.