Can someone look and help
I have a function that returns the date in this format
[10/Apr/2002:01:17:27 +1000] but I'm having trouble returning the last date
in the file.
$totalhits = count($fcontents);
$filename = ("combined_log"); //open file
$fcontents = file($filename); //read into array
//print_r($fcontents);
$limit = 1;
for ($i = 0; $i < $limit; $i++) //loop
{
$line = $fcontents[$i];
if (!empty($line))
{
$currentdate = getmydate($line); //call function that returns first date.
This is OK
$currentdate = substr($currentdate, 1);
$currentdate= substr_replace($currentdate, " ", -15);
echo "First day of access " .$currentdate;
$lastdate = getmydate($fcontents[count($fcontents)-1]);
//**************This is returning nothing?
$lastdate = substr($lastdate, 1);
$lastdate= substr_replace($lastdate, " ", -15);
echo "<br>Last day of access " .$lastdate;
}
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php