PHP code example of luchaninov / csv-file-loader
1. Go to this page and download the library: Download luchaninov/csv-file-loader library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
luchaninov / csv-file-loader example snippets
$loader = new CsvFileLoader('/path/to/your_data.csv');
foreach ($loader->getItems() as $item) {
var_dump($item); // do something here
}
(new CsvStringLoader($s))->getItemsArray();
(new TsvStringLoader($s))->getItemsArray();
(new AutoStringLoader($s))->getItemsArray();