1. Go to this page and download the library: Download michaelsharman/parsecsv 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/ */
michaelsharman / parsecsv example snippets
use ParseCsv\ParseCsv;
$csv = new ParseCsv('data.csv');
print_r($csv->data);
use ParseCsv\ParseCsv;
$csv = new ParseCsv();
$csv->encoding('UTF-16', 'UTF-8');
$csv->delimiter = "\t";
$csv->parse('data.tsv');
print_r($csv->data);
use ParseCsv\ParseCsv;
$csv = new ParseCsv();
$csv->auto('data.csv');
print_r($csv->data);
use ParseCsv\ParseCsv;
$csv = new ParseCsv();
$csv->sort_by = 'id';
$csv->parse('data.csv');
# "4" is the value of the "id" column of the CSV row
$csv->data[4] = array('firstname' => 'John', 'lastname' => 'Doe', 'email' => '[email protected]');
$csv->save();
use ParseCsv\ParseCsv;
$csv = new ParseCsv();
$csv->save('data.csv', array(array('1986', 'Home', 'Nowhere', '')), true);
use ParseCsv\ParseCsv;
$csv = new ParseCsv();
$csv->output('movies.csv', $array, array('field 1', 'field 2'), ',');
"michaelsharman/parsecsv-for-php": "dev-master"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.