ptachoire / tac
Tac and tail library.
Installs: 5 683
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 4
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2020-07-16 12:26:16 UTC
README
Tac is a tac and a tail php implementation for text files.
Usage
If /path/to/file contains
contains this :
abc
def
ghi
tac()
will return
$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
$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