OK, I'm baffled.
I have a multidemionsal array with 660 records in it. When I run my foreach I should get one record for each pass but what I get is just the first record. I upped my error reporting and I get nothing back and I'm not allocating any memory in the foreach (just outputting table contents).
Code looks like this:
$totCount = count($funnel);
echo "We found $totCount log entries<br><br>
"; // 66x records!
echo "<table border='1'>
";
echo "<tr><th>Visitor</th><th>Date</th><th>Time/Page ---></th></tr>
";
$nCount = 0; // number of records
$nRec = 0;
$ip = ""; // current records ip address
$date = ""; // current records date
$time = ""; // current records time
$file = ""; // file that was viewed
foreach($funnel as $page);
{
// process each record
$nRec++;
// if the ip's are different, this is a new visitor
if( strcmp($page['ip'], $ip) != 0 )
{
if($nCount > 0) // only end a row if its not the first one
echo "</tr>
"; // close out this row
// update the variables
$ip = $page['ip']; // save the new visitors ip
$date = $page['date']; // save the new visitors date
$time = $page['time']; // save the new visitors time
$file = $page['path']; // save the new visitors file viewed
echo "<tr>
"; // start a new row
echo "<td>$ip</td><td>$date</td>
";
echo "<td>$time<br>$file</td>";
$nCount++;
}
else
{
// not a new visit
$time = $page['time']; // what time was this page viewed?
$file = $page['path']; // where did they go next?
echo "<td>$time<br>$file</td>";
}
}
echo "</table>";
echo "<br>Processing Complete. $nCount visitors of $totCount/$nRec";
The above line says I had 1 visitor of 66x and nRec is 1 showing the foreach executed 1 time.
Any help would be appreciated!