2017 © Pedro Peláez
 

library associative-spreadsheet-iterator

image

webgriffe/associative-spreadsheet-iterator

  • Thursday, November 12, 2015
  • by mmenozzi
  • Repository
  • 9 Watchers
  • 1 Stars
  • 13,025 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 11 % Grown

The README.md

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 are supported., (*1)

For example, given a spreadsheet like this:, (*2)

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

You can iterate over this and get every row as associative array like this:, (*3)

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

You can install this library with Composer:, (*4)

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

Usage

Simply inlcude Composer's autoloader and instantiate the iterator passing the file path:, (*5)

<?php

require 'vendor/autoload.php'

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

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

The Versions

12/11 2015

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable

12/11 2015

1.6.1

1.6.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable

07/07 2015

1.6.0

1.6.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable

07/07 2015

v0.05

0.05.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable

13/01 2015

v0.04

0.04.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable

25/06 2014

v0.03

0.03.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable

01/06 2014

v0.02

0.02.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable

01/06 2014

v0.01

0.01.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

  • mikey179/vfsstream @stable