$f = fopen("e:/datefile.txt", "r") or die("Error open file!");
$s = "";
$word = "Applications";
$found = 0;
while(!feof($f)) {
$s = fgets($f);
if (strpos($s, $word) !== false) {
$found = 1;
break;
}
}
fclose($f);
echo "The word: " . $word;
if ($found == 1)
echo " exist";
else
echo " NOT exist";
echo " in text file: datefile.txt"
/*
run
The word: Applications exist in text file: datefile.txt
*/