PHP code example of webgriffe / associative-spreadsheet-iterator

1. Go to this page and download the library: Download webgriffe/associative-spreadsheet-iterator 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/ */

    

webgriffe / associative-spreadsheet-iterator example snippets


array(
    array(
        'Name' => 'RaspberryPi',
        'Description' => 'Raspberry PI Modell B, 512 MB',
        'Price' => 37.05,
        'Stock' => 12,
    ),
    array(
        'Name' => 'SanDisk Ultra SDHC',
        'Description' => 'SanDisk Ultra SDHC 8 GB 30 MB/s Classe 10',
        'Price' => 6.92,
        'Stock' => 54,
    ),
),



 = '/path/to/spreadsheet.xlsx';
$spreadsheetIterator = new Webgriffe\AssociativeSpreadsheetIterator\Iterator($file);

foreach ($iterator as $row) {
	// $row is an associative array indexed by column name
}