k1low/ginq-csv

CSV generator for Ginq

Fund package maintenance!
k1LoW

v0.9.4 2014-11-30 09:25 UTC

This package is auto-updated.

Last update: 2024-12-06 09:51:51 UTC


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"