ryoueno / csv
There is no license information available for the latest version (v1.1) of this package.
v1.1
2017-04-08 07:52 UTC
Requires (Dev)
- phpunit/phpunit: ^6.0
This package is not auto-updated.
Last update: 2025-05-02 23:11:51 UTC
README
Installation
You can use Composer or simply Download the Release.
composer require ryoueno/csv
Usage
[0] Get csv ready.
id, name,
1, "UDON",
2, "SHUSHI",
・
・
・
[1] Make src instance just to set your path of csv file.
$src = new \Gojiro\Src('path/to/MyCSV.csv');
[2] Make instance of csv by setting it.
$csv = new \Gojiro\Csv($src);
[3] Get data.
$csv->get(); /* [ 0 => [ 'id' => 1, 'name' => 'UDON', ], 1 => [ 'id' => 2, 'name' => 'SHUSHI', ] . . . ] */
[4] You can use select/where query like DB language.
$csv->select(['name'])->where->(['id' => 2])->get(); /* [ 1 => [ 'name' => 'SHUSHI', ] ] */