jbzoo/csv

Simple parser and writer for CSV files

1.0.1 2016-09-02 17:56 UTC

README

Simple parser and writer for CSV files

License Latest Stable Version Scrutinizer Code Quality

Example

require_once './vendor/autoload.php'; // composer autoload.php

// Get needed classes
use JBZoo\Csv\Csv;

// Just use it!
$csvFile = new Csv(__DIR__ . '/file.csv');
$data = $csvFile
    ->setFile(__DIR__ . '/file.csv')
    ->setDelimiter(',')
    ->setEnclosure('"')
    ->hasHeader(true)
    ->parse();
    
$rangeData = $csvFile->parseRange($start, $limit);
$lineData  = $csvFile->parseLine($lineNumber);
$header    = $csvFile->parseHeader();

Unit tests and check code style

make
make test-all

License

MIT