1. Go to this page and download the library: Download colbygatte/smart-csv 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/ */
colbygatte / smart-csv example snippets
$csv = csv(['name', 'age']);
$csv->append(['Mark', 28], ['Colby', 26]) // Multiple rows can be passed at once
->write('info.csv');
foreach (csv_sip('people.csv') as $row) {
echo $row->name;
}
$alter = csv_alter('people.csv', 'altered-people.csv');
foreach ($alter as $row) {
// Change stuff
$row->name = strtoupper($row->name);
// If the delete() method is called on the row, it will not be