PHP code example of atomatis / simple-data-table-reader
1. Go to this page and download the library: Download atomatis/simple-data-table-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/ */
atomatis / simple-data-table-reader example snippets
$reader = SimpleReaderFactory::createTableDataReader('file/table_data.xlsx'/*, ?string $forceExtension*/);
$reader->getHeader(); // return ['name', 'ref_id', 'tel_n']
foreach ($reader->getIterator() as $row) {
// offset 1
$row->get('name'); // return 'nadege'
$row->get('ref_id'); // return 'AR4F9EJ'
$row->get('wrong_ref'); // return null
$row(); // return ['name' => 'nadege', 'ref_id' => 'AR4F9EJ', 'tel_n' => '06 54 65 66 77']
}