convert them to xhtml - with all lower case tags
read the file into a string
http://www.php.net/fopen
http://www.php.net/fread
use
http://www.php.net/strip_tags
then turn the resulting string into an array
http://www.php.net/explode
then use this function
function count_occurences($in_ary) {
$out_ary = array();
foreach($in_ary as $word) {
if(array_key_exists($word,$out_ary)) {
$out_ary['word']++;
} else {
$out_ary['word'] = 0;
} //end if
} //end foreach
return $out_ary;
} //end count_occurences
then see if the word exists in the array produced by this function with
http://www.php.net/array_key_exists
You can use the counts to do ordering by the number of times the word occurs but that is left as an exercise for the reader.