Tag Archives: tail

php tail

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:

  1. 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.