Pattern matching is the best route to use. I don't know what format you'll allow, but I will say its a single text entry line separated with spaces. This example (though untested) will try to scan only a single directory and is not built for recursion.
PHP Code:
$keywords = str_replace(' ', '\'|\'', $inputKeywords);
$matches = array();
foreach (glob('*') AS $file)
{
if (is_file($file))
{
$sFileContents = file_get_contents($file);
if (preg_match('/\'[' . $keywords . ']\'/msi', $sFileContents))
{
$matches[] = $file;
}
}
}
I don't know if something like this will work, but off hand it looks like it should do the job. $inputKeywords is whatever you're entry is, including whatever cleaning you need to do to it.