stupid array question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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");
   }
  }


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux