1. Go to this page and download the library: Download mahmud/sheet 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/ */
mahmud / sheet example snippets
use Mahmud\Sheet\SheetReader;
SheetReader::makeFromCsv('/path-to-csv-file/example-file.csv')
->delimiter(",") // Optional: You can set delimiter for CSV file
->ignoreRow(0) // Optional: Skip the header row
->columns(['id', 'name', 'age']) // Arbitary column name that will be mapped sequentially for each row
->onEachRow(function($row, $index){
// This callback will be executed for each row
var_dump($row); // Current row in associative array
var_dump($index); // Current index of the row
})->read();