PHPackages                             webgriffe/associative-spreadsheet-iterator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. webgriffe/associative-spreadsheet-iterator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

webgriffe/associative-spreadsheet-iterator
==========================================

1.6.1(10y ago)132.7kMITPHP

Since Jun 1Pushed 8y ago9 watchersCompare

[ Source](https://github.com/webgriffe/associative-spreadsheet-iterator)[ Packagist](https://packagist.org/packages/webgriffe/associative-spreadsheet-iterator)[ RSS](/packages/webgriffe-associative-spreadsheet-iterator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

Associative Spreadsheet Iterator
================================

[](#associative-spreadsheet-iterator)

This PHP library allows you to iterate over a spreadsheet in an associative way. Every iterated row is indexed by column name. All formats supported by [phpoffice/phpexcel](https://github.com/PHPOffice/PHPExcel) are supported.

For example, given a spreadsheet like this:

NameDescriptionPriceStockRaspberryPiRaspberry PI Modell B, 512 MB37.0512SanDisk Ultra SDHCSanDisk Ultra SDHC 8 GB 30 MB/s Classe 106.9254You can iterate over this and get every row as associative array like this:

```
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,
    ),
),

```

Installation
------------

[](#installation)

You can install this library with **Composer**:

```
$ composer require webgriffe/associative-spreadsheet-iterator @stable

```

Usage
-----

[](#usage)

Simply inlcude Composer's autoloader and instantiate the iterator passing the file path:

```
