1. Go to this page and download the library: Download lekoala/spread-compat 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/ */
lekoala / spread-compat example snippets
SpreadCompat::$preferredCsvAdapter = SpreadCompat::NATIVE; // our native csv adapter is the fastest
SpreadCompat::$preferredXlsxAdapter = SpreadCompat::NATIVE; // our native xlsx adapter is the fastest
$data = iterator_to_array(SpreadCompat::read('myfile.csv'));
// or
foreach(SpreadCompat::read('myfile.csv') as $row) {
// Do something
}