PHP code example of k1low / ginq-csv

1. Go to this page and download the library: Download k1low/ginq-csv library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

k1low / ginq-csv example snippets




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"