I am in the process of creating a logging script which store info in a flat text file in the following format
Date|IP|BrowserInfo|
I can count all the records in the file and output the info in readable form with the following script
I was wondering how to count unique values only using IP address for example. I would also like to count browser types.
Anyone got any ideas?
Thanks
Ian It's not a lie if you believe it!
Date|IP|BrowserInfo|
I can count all the records in the file and output the info in readable form with the following script
Code:
<?php
$total=0;
$fcontents = file("logfile.txt","r");
while (list ($line_num, $line) = each ($fcontents)) {
$total=$total+1;
list($string1,$string2,$String3)=explode("|",$line);
echo
"<b>Date/Time: </b>",$string1,"<br>",
"<b>Remote Address: </b>",$string2,"<br>",
"<b>Browser/OS: </b>",$string3,"<p>";
}
echo "<p><b>Total Visitors = ",$total,"</b><br>\n";
?>
I was wondering how to count unique values only using IP address for example. I would also like to count browser types.
Anyone got any ideas?
Thanks
Ian It's not a lie if you believe it!