k1low / ginq-csv
CSV generator for Ginq
Fund package maintenance!
k1LoW
Installs: 9 373
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >= 5.3.3
- ginq/ginq: ~0.2.3
Requires (Dev)
- phpunit/phpunit: >=4.1.0
README
CSV generator for Ginq
Install
composer.json:
{ "require": { "k1low/ginq-csv": "~0.9.4" } }
Usage
<?php use Ginq; use Ginq\GinqCsv; Ginq::register('Ginq\GinqCsv'); $data = array( array( 'id' => 1, 'title' => 'Title', 'body' => 'Hello World', 'created' => '2014-11-28 00:00:00', ), array( 'id' => 2, 'title' => 'タイトル', 'body' => 'こんにちは世界', 'created' => '2014-11-29 00:00:00', ), ); $result = Ginq::from($data) ->toCsv($options); // output string // "1","Title","Hello World","2014-11-28 00:00:00" // "2","タイトル","こんにちは世界","2014-11-29 00:00:00"