Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Text_LTSV

LTSV parser and generator for PHP.

Installation

$ pear channel-discover openpear.org
$ pear install openpear/Text_LTSV-1.0.0

Usage

require_once 'Text/LTSV.php';

$assoc = Text_LTSV::parseLine("hoge:foo\tfuga:bar\tpiyo:baz");
echo $assoc['hoge']; //=> foo
echo $assoc['fuga']; //=> bar
echo $assoc['piyo']; //=> baz

$array = Text_LTSV::parse("hoge:foo\tfuga:bar\npiyo:baz");
echo count($array); //=> 2
echo $array[1]['piyo']; //=> baz

echo Text_LTSV::generateLine(array('hoge' => 'foo', 'fuga' => 'bar', 'piyo' => 'baz'));
//=> hoge:foo\tfuga:bar\tpiyo:baz

echo Text_LTSV::generate(array(
  array('hoge' => 'foo', 'fuga' => 'bar'),
  array('piyo' => 'baz'),
));
//=> hoge:foo\tfuga:bar\npiyo:baz

License

Copyright (c) 2013 Takamasa Aoi. See LICENSE in this directory.

About

LTSV parser and generator for PHP

Resources

License

Releases

No releases published

Languages

You can’t perform that action at this time.