The Problem
You want the functionality of tail(1) in a php function.
The Solution
Bellow is a php function that gives you the last N lines from a file. It doesn't do everything tail(1) does ( like following, retrying, etc ) but just the basic stuff:
span style="color: #ff0000;">'r'"";$ret="""\n"""
It may not be the fastest solution but it works.
Have a better one? Please let me know about it.
I’ve written a small PHP tail -f class that is similar to this. You can view the source code at http://code.google.com/p/php-tail/