Skip to content
Simple library to read and write CSV files (includes a RFC 4180 compliant implementation)
Branch: master
Clone or download
Latest commit 28872f5 Feb 26, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Deprecate `Ajgl\Csv\Writer\RfcWriter::arrayToString` Feb 25, 2016
tests
.gitignore
.php_cs New CS rules Feb 13, 2016
.scrutinizer.yml New scrutinizer-ci configuration Sep 29, 2015
.travis.yml Remove PHP 5.3 support Feb 12, 2016
CHANGELOG.md
LICENSE Update year in copyright notice Feb 25, 2016
README.md
composer.json
phpunit.xml.dist Migration to PSR-4 Sep 29, 2015

README.md

AjglCsv

The AjglCsv component allows you to read and write CSV files.

Build Status Latest Stable Version Latest Unstable Version Total Downloads Montly Downloads Daily Downloads License Scrutinizer Code Quality Code Coverage SensioLabsInsight StyleCI

There are currently two different implementations for the reader and writer classes:

  • An implementation using the native fgetcsv and fputcsv functions
  • An implementation compatible with the RFC 4180

Installation

To install the latest stable version of this component, open a console and execute the following command:

$ composer require ajgl/csv

Usage

The simplest way to use this library is to create a Ajgl\Csv\Csv instance with:

$csv = Ajgl\Csv\Csv::create();

By default, the library uses the native f??tcsv functions. If you want to read or write RFC 4180 compatible files, you should set the default reader and writer types to rfc with:

$csv->setDefaultReaderType('rfc');
$csv->setDefaultWriterType('rfc');

To create a new CSV reader or writer, you should call:

$reader = $csv->createReader('/path/to/input.csv');
$writer = $csv->createWriter('/path/to/output.csv');

Symfony Bundle

If you need to integrate these library into your Symfony Framework app, you can install the AjglCsvBundle.

License

This component is under the MIT license. See the complete license in the LICENSE file.

Reporting an issue or a feature request

Issues and feature requests are tracked in the Github issue tracker.

Author Information

Developed with ♥ by Antonio J. García Lagar.

If you find this component useful, please add a ★ in the GitHub repository page and/or the Packagist package page.

You can’t perform that action at this time.