bdunn313 / csv

CSV data manipulation made easy in PHP

Home Page:http://csv.thephpleague.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSV

Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

League\Csv is a simple library to ease CSV parsing, writing and filtering in PHP. The goal of the library is to be as powerful while remaining lightweight, by utilizing PHP native classes whenever possible.

League\Csv was designed for developers who wants to deal with CSV data using modern code and without the high levels of bootstrap and low-levels of usefulness provided by existing core functions or third party-code.

This package is compliant with PSR-2 and PSR-4.

System Requirements

You need PHP >= 5.4.0 and the mbstring extension to use League\Csv but the latest stable version of PHP is recommended.

Install

Install the csv package with Composer.

{
    "require": {
        "league/csv": "5.*"
    }
}

Documentation

Csv has full documentation, powered by Sculpin.

Contribute to this documentation in the sculpin branch.

Tips

  • When creating or editing a document using League\Csv\Writer, first insert all the data that need to be inserted before anything else. If you manipulate your data before insertion, you may change the file cursor position and get unexpected results.

  • Even thought you can iterate over you document using League\Csv\Writer class, it is recommend and best practice to iterate over you CSV using the League\Csv\Reader class to avoid any issue.

  • The library assumes that your data is UTF-8 encoded. If your are dealing with non-unicode data you must enable your data conversion into UTF-8 otherwise output methods will failed. You can transcode you CSV :

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

About

CSV data manipulation made easy in PHP

http://csv.thephpleague.com/

License:MIT License