I have been using the file() function with no problem with smaller files. I have been trying to open my access_log with file and it times out saying, the document contains no data. Here is the code I use:
<?php
$log = file("/opt/apache/logs/access_log");
if(!$log)
{
echo("error opening file");
die;
}
else
{
for($i=0;$i<count($log);$i++)
{
$hit = explode(" ",$log[$i]);
echo("$hit[0] -- $hit[1] -- $hit[2] -- $hit[3] <br>\n");
}
}
?>
This is a variation on a code snippit I found on this site. access_log is is about 218 meg. Is this too big? If so is there anyway around this? I am mostly interested in the data from the bottom, is there anyway I cen get jsut that. Something like "tail access_log" in UNIX.
Any help will be appreciated,
Thanks,
Tim.