ConFoo Montreal 2026: Call for Papers

Voting

: min(one, three)?
(Example: nine)

The Note You're Voting On

Tom Pittlik
16 years ago
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):

<?php

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;
}

?>

<< Back to user notes page

To Top