well.... here is a little something to get you started if this is the route you really want to go.
PHP Code:
<?php
$handle = file_get_contents("test_text.txt",NULL);
$a="hello, hi welcome to php";
$a=str_replace(",","",$a);
$a=explode(" ",$a);
$c=0;
foreach($a as $y){
if (stristr($handle,"$a[$c]")) $b[]= 'yes';
else $b[]='no';
$c++;
}
echo $handle;
if (in_array("no",$b)) echo '<br><br>did not match';
else echo '<br><br>we have a match';
?>
It will scan one document for the selected terms. If they all appear then "we have a match". If one of the terms is not found in the document then "did not match".
You should be able to figure the rest out from here with the possible exception of gathering all of the file names in a directory. Either way this should help you get started. Let us know if you get stuck anywhere.
EDIT: I kinda regret posting the above code. It does have its uses for correcting poor coding across directories of bad files, but to use it as a search program is really a poor way to use it. data like this should be stored in a database like MySQL and searched that way. You will have far greater control over your searches and the coding will be much simpler as well.
Bookmarks