I have the following code which should increment the value of the array
$iplist if there is a value there. When I walk the array at the end,
all the values = 1. What am i doing wrong?
--Curtis
while (!feof($INPUTFILE))
{
$chunks = fgetcsv($INPUTFILE, " ", '"');
$firstpart = explode(" ", $chunks[0]);
$ipaddress = $firstpart[0];
$agent =
$chunks[4];
// print (stripos($agent, "compatible;
MSIE 6.0; Windows NT 5.1; SV1")."\n");
if
(stripos($agent, "compatible; MSIE 6.0; Windows NT 5.1; SV1")
> 0)
{
$iplist[$ipaddress]++;
//print("$ipaddress\t$agent\n");
}
while (list($key, $value) = each($iplist))
{
print("$key\t$value\n");
}
}