chrisullyott/php-csv

CSV-to-array conversion in PHP.

v1.0.0 2017-12-24 19:47 UTC

This package is auto-updated.

Last update: 2024-12-20 19:30:10 UTC


README

CSV-to-array conversion in PHP.

Installation

With Composer:

$ composer require chrisullyott/php-csv

Usage

$parser = new CsvParser('/path/to/data.csv');

$items = $parser->getItems();

print_r($items);
Array
(
    [0] => Array
        (
            [id] => 15
            [first_name] => Ethan
            [last_name] => Hunt
        )

    [1] => Array
        (
            [id] => 16
            [first_name] => Jim
            [last_name] => Phelps
        )

    [2] => Array
        (
            [id] => 17
            [first_name] => Luther
            [last_name] => Stickell
        )

)