2017 © Pedro Peláez
 

library csv-table-generator

Create a CSV file with PHP array.

image

ecommit/csv-table-generator

Create a CSV file with PHP array.

  • Wednesday, August 16, 2017
  • by e-commit
  • Repository
  • 1 Watchers
  • 0 Stars
  • 488 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 16 % Grown

The README.md

CSV Table Generator

Create a CSV file with PHP array., (*1)

Tests, (*2)

Installation

To install csv-table-generator with Composer just run :, (*3)

$ composer require ecommit/csv-table-generator

Usage

use Ecommit\CsvTableGenerator\Csv;

$csv = new Csv('/home/test', 'myfilename', array(
    'header' => array(
        'Column A',
        'Column B',
    ),
));

$csv->write(array('Hello', 'world')); //Add line
$csv->write(array('Test1', 'Test2')); //Add line
$csv->close();

/home/test/myfilename.csv is generated :, (*4)

"Column A","Column B"
Hello,world
Test1,Test2

Constructor arguments :, (*5)

  • String $pathDir : Path folder (when CSV file is generated) Required
  • String $filename : Filename (without path folder and extension) Required
  • Array $options : Options. See below

Availabled options :, (*6)

  • header (array) : Header array. If empty, no header. Default: array()
  • max_lines (null | int) : Max lines per CSV file. If lines > max_lines, many files are generated. Default: null
  • delimiter (string) : CSV delimiter. Default: ,
  • enclosure (string) : CSV enclosure. Default: "
  • eol (string - Csv::EOL_ constants) : EOF(End Of Line) character. See Csv::EOL_ constants. Default: Csv::EOL_LF. If Csv::EOL_CRLF is used with PHP ≤ 8.1, unix2dos program is required
  • escape : CSV escape. Default: \
  • unix2dos_path (string) : Unix2dos path. Only used if eol=Csv::EOL_CRLF with PHP ≤ 8.1. Default: /usr/bin/unix2dos
  • add_utf8_bom (bool) : Add or not UTF8 bom. Default: false

License

This librairy is under the MIT license. See the complete license in LICENSE file., (*7)

The Versions

16/08 2017

dev-master

9999999-dev

Create a CSV file with PHP array.

  Sources   Download

MIT

by Hubert Lecorche

csv array table

16/08 2017

v1.0.1

1.0.1.0

Create a CSV file with PHP array.

  Sources   Download

MIT

by Hubert Lecorche

csv array table

27/08 2016

v1.0.0

1.0.0.0

Create a CSV file with PHP array.

  Sources   Download

MIT

by Hubert Lecorche

csv array table