library text-ltsv
Labeled Tab-separated Values (LTSV; cf. http://ltsv.org/) parser for PHP.
clover/text-ltsv
Labeled Tab-separated Values (LTSV; cf. http://ltsv.org/) parser for PHP.
- Tuesday, January 31, 2017
- by hiro_y
- Repository
- 1 Watchers
- 11 Stars
- 17,565 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 5 % Grown
Text-LTSV
, (*1)
Labeled Tab-separated Values (LTSV; cf. http://ltsv.org/) parser for PHP., (*2)
Install
Using Composer as a dependency management tool, you can bring Clover\Text\LTSV
in your environment easily with settings below., (*3)
{
"require": {
"clover/text-ltsv": "~1.0"
}
}
Usage
<?php
$ltsv = new Clover\Text\LTSV();
$values = $ltsv->parseLine("hoge:foo\tbar:baz");
$values = $ltsv->parseFile('log.ltsv');
$it = $ltsv->getIteratorFromFile('log.ltsv');
foreach ($it as $values) {
// do something
}
$ltsv->add('hoge', 'foo')->add('bar', 'baz');
$line = $ltsv->toLine();
License
Free to use under the terms of the New BSD License., (*4)