PHP code example of jeroenzwart / php-csv-iterator
1. Go to this page and download the library: Download jeroenzwart/php-csv-iterator 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/ */
jeroenzwart / php-csv-iterator example snippets
bash
$ composer
php
$csv = new \JeroenZwart\CsvIterator\CsvReader('../csv/movies.csv');
$line = $csv->next()->current();
php
$csv = new CsvReader('../csv/actors.csv', 3, 5);
foreach ($csv as $line) {
// Do something with $line...
}
php
$csv = new CsvReader('../csv/actors.csv');
$csv->delimiter(';')->enclose('`')->escape('');
foreach ($csv as $line) {
// Do something with $line...
}
php
$csv = new CsvReader('../csv/actors.csv');
$csv->headers(false)->asObject(false)->empty(true);
foreach ($csv as $line) {
// Do something with $line...
}
php
$csv = new CsvReader('../csv/actors.csv');
var_dump($csv->position(3));
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.