You can use the in_array() functions to search an array.
For example...
$keywords = file('keywords.dat');
if (in_array($word,$keywords)) {
//do some stuff
}
If you need to find the position of $word in the array, use array_search(), which will return the array key upon finding $word, instead of just returning true.