I've been working on the following snippet:
The snippet fetches the first word on each line in the textfile.
What I need to do is to check if the word on the line is already collected, since I only want one occurance of each word. Anybody got any ideas?
Thank you!
PHP:
$lines = file('http://www.example.com/thefile.txt');
foreach ($lines as $line_num => $line)
{
echo substr($line,0,strpos($line,' ')), "<br/>\n";
}
The snippet fetches the first word on each line in the textfile.
What I need to do is to check if the word on the line is already collected, since I only want one occurance of each word. Anybody got any ideas?
Thank you!







