OK, I did this and it does nothing but cause a loop and crash my browser...

<?
exec("tail -n 100 /www/logs/access.log",$result);

for ($i=0; $i<$result; $i++)
{
  echo "$result<BR>";
}
?>

What's the problem with that?

Cheers,
Liam


----- Original Message -----
From: "Tom Rogers" <[EMAIL PROTECTED]>
To: "Liam MacKenzie" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 4:35 PM
Subject: Re: [PHP] Tailing a log file {!?}


Hi
You need
exec("tail -n 100 access_log",$result);
$result will be an array with the output of the command.
see http://www.php.net/manual/en/ref.exec.php
for more info
Tom



At 01:51 PM 4/05/2002, Liam MacKenzie wrote:
>Hi guys,
>
>just a simple question, how would I go about displaying the last 100 lines
>of a log file?
>I know that on the command line it's:
>tail -n 100 access_log
>
>Is there a PHP function to do this?
>
>Cheers,
>Liam
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to