library tac
Tac and tail library.
ptachoire/tac
Tac and tail library.
- Friday, November 8, 2013
- by krichprollsch
- Repository
- 1 Watchers
- 1 Stars
- 4,707 Installations
- PHP
- 2 Dependents
- 0 Suggesters
- 0 Forks
- 4 Open issues
- 2 Versions
- 0 % Grown
Tac
Tac is a tac
and a tail php implementation for text files., (*1)
, (*2)
Usage
If /path/to/file contains
contains this :, (*3)
abc
def
ghi
tac()
will return, (*4)
$tac = new \Tac\Tac( '/path/to/file' );
var_dump($tac->tac(2));
/*
array(2) {
[0] =>
string(3) "ghi"
[1] =>
string(3) "def"
}
*/
tail()
will return, (*5)
$tac = new \Tac\Tac( '/path/to/file' );
var_dump($tac->tail(2));
/*
array(2) {
[0] =>
string(3) "def"
[1] =>
string(3) "ghi"
}
*/
Unit Tests
phpunit
Thanks
Files structure inspired by Geocoder
from William Durand, (*6)