rap2hpoutre/csv-to-associative-array

CVS to associative array

v0.0.3 2016-06-09 11:29 UTC

This package is auto-updated.

Last update: 2022-01-05 14:08:46 UTC


README

This package only contains a 587 bytes function: csv_to_associative_array.

What?

Get your CSV file as an associative array. From this:

name,email
raphael,raphael@example.org
lisa,lisa@example.org

To this:

[ 
  ['name' => 'raphael', 'email' => 'raphael@example.org'], 
  ['name' => 'lisa',    'email' => 'lisa@example.org'] 
]

How?

Install via composer

composer require rap2hpoutre/csv-to-associative-array

Use

$content = \Rap2hpoutre\Csv\csv_to_associative_array('path/to/csv/file.csv');