Search by

CSV Reader and Writer

Package info

github.com/palmtreephp/csv

pkg:composer/palmtree/csv

Statistics

Installs: 7 104

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

v5.1.0 2026-11-15 18:09 UTC

README

License Latest Version PHP Version Build Status PHPStan

A CSV reader and writer for PHP.

The Reader class implements the Iterator interface, loading one line into memory at a time. This means large files can be parsed without hitting any memory limits.

Requirements

  • PHP >= 8.3

Installation

Use composer to add the package to your dependencies:

composer require palmtree/csv

Usage

use Palmtree\Csv\Reader;
use Palmtree\Csv\Writer;

foreach (new Reader('people.csv') as $row) {
    echo $row['name'];
}

Writer::write('people.csv', [
    ['name' => 'Alice', 'age' => 24],
    ['name' => 'Bob', 'age' => 28],
]);

Documentation

See the documentation index for every topic, or jump to a page:

See the examples directory for more usage examples.

License

Released under the MIT license