PHPackages                             arielcr/php-csv-parser - 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. arielcr/php-csv-parser

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

arielcr/php-csv-parser
======================

Convert CSV to array (Excel style is fully supported!)

2.0(3y ago)017.4k—0%MITPHPPHP ^7.1 | ^8.0

Since Oct 19Pushed 3y agoCompare

[ Source](https://github.com/arielcr/PHPCsvParser)[ Packagist](https://packagist.org/packages/arielcr/php-csv-parser)[ RSS](/packages/arielcr-php-csv-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

PHPCsvParser
============

[](#phpcsvparser)

> This is a fork of [kzykhys/PHPCsvParser](https://github.com/kzykhys/PHPCsvParser).
>
> The only purpose of this fork is to fully support PHP 8 and fix some deprecation warnings.
>
> All of the core functionality remains the same.

Convert CSV to array/Iterator (Excel style is fully supported!)

Why PHPCsvParser?
-----------------

[](#why-phpcsvparser)

As you know, PHP has built-in `fgetcsv` function. But has some probrems:

- Line breaks in the cell
- Multibyte string (especially NON UTF-8)
- Double quote in the cell

Requirements
------------

[](#requirements)

**PHP5.3.3 or later**

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

[](#installation)

Create or modify your composer.json

```
{
    "require": {
        "kzykhys/php-csv-parser": ">1.4"
    }
}
```

And run

```
$ php composer.phar install
```

Usage
-----

[](#usage)

### Parse a CSV file

[](#parse-a-csv-file)

```
1,"some text",150
2,"some multi line
text",2000

```

```
