avin/csv-commander

CSV file operations lib.

dev-master 2015-10-04 12:33 UTC

This package is not auto-updated.

Last update: 2024-11-13 11:31:10 UTC


README

CSV file operations library.

  • Read CSV file to array.
  • Write array to CSV file.

Code Examples

use Avin\CSVCommander\CSVCommander;

$csvCommander = new CSVCommander();
$fileName = __DIR__.'/my.csv';
$data = [
    ['foo1', 'foo2', 'foo3'],
    ['bar1', 'bar2', 'bar3'],
];

//Write array to CSV file
$result = $csvCommander->saveData($fileName, $data);

//Read CSV to array
$resultData = $csvCommander->getData($fileName);

License

CSVCommander is licensed under the MIT License.

Copyright 2015 Avin Grape