This package only contains a 587 bytes function: csv_to_associative_array
.
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']
]
Install via composer
composer require rap2hpoutre/csv-to-associative-array
Use
$content = \Rap2hpoutre\Csv\csv_to_associative_array('path/to/csv/file.csv');