In php, opening a text file and determining the most frequntly used word in that file?

Matt

New member
Hey everyone,

What should I add to this code to help me find the most used word in a text file??

Here is my code so far

<?php

$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo $theData;

?>

Should i store the contents of the file in an array then run a loop??

Thank you!!!
 
Back
Top