PHP code example of koenvanmeijeren / spreadsheet-reader
1. Go to this page and download the library: Download koenvanmeijeren/spreadsheet-reader 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/ */
koenvanmeijeren / spreadsheet-reader example snippets
$reader = new KoenVanMeijeren\SpreadsheetReader\SpreadsheetReader('example.xlsx');
foreach ($reader as $row)
{
print_r($row);
}
$reader = new KoenVanMeijeren\SpreadsheetReader\SpreadsheetReader('example.xlsx');
$sheets = $reader->sheets();
foreach ($sheets as $index => $name) {
echo 'Sheet #'.$index.': '.$name;
$reader->changeSheet($index);
foreach ($reader as $row)
{
print_r($row);
}
}