Merge pull request #78 from lbajsarowicz/patch-1

Documentation: added example usage of fields variable
This commit is contained in:
Fonata
2017-11-03 11:13:47 -06:00
committed by GitHub

View File

@@ -79,6 +79,14 @@ $csv->data[4] = array('firstname' => 'John', 'lastname' => 'Doe', 'email' => 'jo
$csv->save(); $csv->save();
``` ```
**Replace field names or set ones if missing**
```php
$csv = new parseCSV();
$csv->fields = ['id', 'name', 'category']
$csv->parse('data.csv');
```
**Add row/entry to end of CSV file** **Add row/entry to end of CSV file**
_Only recommended when you know the extact structure of the file._ _Only recommended when you know the extact structure of the file._