PHPackages                             jralph/phpcsvparser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jralph/phpcsvparser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jralph/phpcsvparser
===================

A simple csv parser for php.

3.0.1(11y ago)136MITPHPPHP &gt;=5.4.0

Since Jul 16Pushed 10y ago2 watchersCompare

[ Source](https://github.com/jralph/PHPCSVParser)[ Packagist](https://packagist.org/packages/jralph/phpcsvparser)[ RSS](/packages/jralph-phpcsvparser/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (8)Dependencies (3)Versions (9)Used By (0)

PHP CSV Parser [![Build Status](https://camo.githubusercontent.com/15f198af2253f860b98cb03f6cbb8a182ee02893e843dabe303f0f33955c74d9/68747470733a2f2f7472617669732d63692e6f72672f6a72616c70682f5048504353565061727365722e737667)](https://travis-ci.org/jralph/PHPCSVParser) [![SensioLabsInsight](https://camo.githubusercontent.com/8360457208d4e7a9cd82592a6736b48fa7669623c6e747aee33c9af3cbe01ecf/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61653363323531322d386132392d343763312d383961332d6430393965616535636262632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/ae3c2512-8a29-47c1-89a3-d099eae5cbbc)
================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#php-csv-parser--)

[![Latest Stable Version](https://camo.githubusercontent.com/64d248728b495f93a5cfb2a0c433dbaf4be2b58b59c55cc30ff75dee7e2c05d7/68747470733a2f2f706f7365722e707567782e6f72672f6a72616c70682f7068706373767061727365722f762f737461626c652e737667)](https://packagist.org/packages/jralph/phpcsvparser) [![Total Downloads](https://camo.githubusercontent.com/bba42bcd2adb23f8e6bca2ec3cf2ea11512279f190f24f7b348a470902b139ca/68747470733a2f2f706f7365722e707567782e6f72672f6a72616c70682f7068706373767061727365722f646f776e6c6f6164732e737667)](https://packagist.org/packages/jralph/phpcsvparser) [![Latest Unstable Version](https://camo.githubusercontent.com/ffc453717f1ab347801b0ba668eb9e87de88aa013668342f7f92b81cd91aff7e/68747470733a2f2f706f7365722e707567782e6f72672f6a72616c70682f7068706373767061727365722f762f756e737461626c652e737667)](https://packagist.org/packages/jralph/phpcsvparser) [![License](https://camo.githubusercontent.com/ceb2e2fdff481d911603bec107917ef6b317e1707ca85f38a7e759a6624370f0/68747470733a2f2f706f7365722e707567782e6f72672f6a72616c70682f7068706373767061727365722f6c6963656e73652e737667)](https://packagist.org/packages/jralph/phpcsvparser)

PHP CSV Parser is a simple csv parser written in php. It can parse csv strings or files.

It utilises [Laravel's Support Library](http://laravel.com/api/namespace-Illuminate.Support.html) to help with providing a simple and clean structure.

### Contents

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Working with the CSV](#working-with-the-csv)
    - [CSV Rows](#csv-rows)

Installation
------------

[](#installation)

PHP CSV Parser is available as a composer package and can be added to your composer.json like so.

```
"require": {
    ...
    "jralph/phpcsvparser": "2.*"
    ...
}

```

Usage
-----

[](#usage)

Using the CSV parser is simple and can be done by directly accessing the `Jralph\PHPCSVParser\ParserManager` class, or either of the Parser classes (`Jralph\PHPCSVParser\Parsers\StringParser` or `Jralph\PHPCSVParser\Parsers\FileParser`).

For ease of use, there is also a `facade` that has been created. `Jralph\PHPCSVParser\Facades\Parser`. This `facade` can call the `create` method on the `ParserManager` object.

```
