Hi,
I'm logging web stats in a simple log.txt.
Right now, I'm making a script that gets several strings/$variables from the textfile.
What I want is when I find the word 'Windows 95', he counts al those words and displays the number of times this word is in the logfile. I've started writing but now I'm a bit stuck, hope someone can help me out here. I already can find the word 'windows 95' but he stops when he finds it, i've tried already with count, and so on, but haven't got a clue what to do right now. I hope someone can help me out here
this is piece of my code:
$file = 'log.txt';
$lines_array = file($file);
$lines_string = implode('', $lines_array);
?>
<head><title>Stats</title></head>
<table>
<?/* windows 95 */
eregi("(Windows 95)", $lines_string, $win95);
?><tr><td>Windows 95:</td><td><? if ($win95 == "") { echo "found nothing"; } else { echo $win95[0]; } ?></td></tr>