note 90450 added to function.fseek
| From: | TomPittlik at osu1 dot php dot net | Date: | Thu, 23 Apr 2009 07:32:18 +0000 |
| Subject: | note 90450 added to function.fseek | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153602@lists.php.net to get a copy of this message | ||
The tail example functions below will return a PHP memory limit error when trying to open large
files. Since tail is convenient for opening large logs, here is a function that lets you (provided
you have permission):
<?
function unix_tail($lines,$file)
{
shell_exec("tail -n $lines $file > /tmp/phptail_$file");
$output = file_get_contents("/tmp/phptail_$file");
unlink("/tmp/phptail_$file");
return $output;
}
?>
----
Server IP: 117.55.229.1
Probable Submitter: 59.167.232.148
----
Manual Page -- http://www.php.net/manual/en/function.fseek.php
Edit -- https://master.php.net/note/edit/90450
Del: integrated -- https://master.php.net/note/delete/90450/integrated
Del: useless -- https://master.php.net/note/delete/90450/useless
Del: bad code -- https://master.php.net/note/delete/90450/bad+code
Del: spam -- https://master.php.net/note/delete/90450/spam
Del: non-english -- https://master.php.net/note/delete/90450/non-english
Del: in docs -- https://master.php.net/note/delete/90450/in+docs
Del: other reasons-- https://master.php.net/note/delete/90450
Reject -- https://master.php.net/note/reject/90450
Search -- https://master.php.net/manage/user-notes.php