I'm writing an app to parse IIS logs
This is what I have so far:
$fp = fopen($file,'r');
$i = 0;
while($line = fgets( $fp ,1024 ))
{ list($date,$time,$s_sitename,$s_ip,$cs_method,$cs_uri_stem,$cs_uri_query,$s_port,$cs_username,$c_ip,$cs_user_agent,$cs_referer,$cs_host,$sc_status,$sc_substatus,$sc_win32_status,$sc_bytes,$cs_bytes) = explode(' ',$line);
}
what Id like to be able to do is iterate over that list within the while loop so for each line of log I can quickly and cleanly build an XML structure dynamically like this:
//LOOP START
$xml .= '<$listVarName>$listVarValue</$listVarName>';
//EG <date>2009-12-03</date>
any ideas?