Sure,
Just read the file in one line at a time. Use strtok() to parse each word out one by one. As you do that use each word as they in an associative array. Voila.
$yourfile = fopen("file.txt");
while (!feof($file))
{
$currentline = fgets($file, 81);
$currentword = strtok($currentline, " ");
while ($currentword != "")
{
$arrayofwords[$currentword]++;
$currentword = strtok(" ");
}
}
blah;
blah;
blah;
Then when you're ready to output:
while ($element = each($arrayorwords))
{
echo $element[ "key" ];
echo $element[ "value"];
echo "<br>";
}
...or add it to database at this point or whatever.