Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rap2hpoutre/csv-to-associative-array
Get your CSV as an associative array
https://github.com/rap2hpoutre/csv-to-associative-array
array composer csv php
Last synced: 24 days ago
JSON representation
Get your CSV as an associative array
- Host: GitHub
- URL: https://github.com/rap2hpoutre/csv-to-associative-array
- Owner: rap2hpoutre
- License: mit
- Created: 2016-06-09T07:33:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-24T13:16:46.000Z (almost 8 years ago)
- Last Synced: 2024-08-10T07:52:55.792Z (3 months ago)
- Topics: array, composer, csv, php
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CSV to associative array
This package only contains a 587 bytes function: `csv_to_associative_array`.
## What?
Get your CSV file as an associative array. From this:
```csv
name,email
raphael,[email protected]
lisa,[email protected]
```To this:
```php
[
['name' => 'raphael', 'email' => '[email protected]'],
['name' => 'lisa', 'email' => '[email protected]']
]
```## How?
Install via composer
```
composer require rap2hpoutre/csv-to-associative-array
```Use
```
$content = \Rap2hpoutre\Csv\csv_to_associative_array('path/to/csv/file.csv');
```