2017 © Pedro Peláez
 

library parsecsv

Extend PHP's native CSV parsing from the SplFileObject class but provide features to use the first row's values as keys on the remaining rows.

image

bluefrg/parsecsv

Extend PHP's native CSV parsing from the SplFileObject class but provide features to use the first row's values as keys on the remaining rows.

  • Wednesday, November 2, 2016
  • by bluefrg
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ParseCsv

:warning: This is the old unsupported master branch: You should not be referencing this branch directly, and it only exists for projects still referencing dev-master., (*1)

Extend PHP's native CSV parsing from the SplFileObject class but provide features to use the first row's values as keys on the remaining rows., (*2)

There are other libraries which accomplish the similar thing, but they are memory inefficient and rely on their own (sometimes buggy) parsing implementation., (*3)

<?php
$oCsv = new ParseCsv('users.csv');
$oCsv->firstRowHeader();

foreach($oCsv as $aRow) {
    print_r($aRow);
}

Given the example users.csv file:, (*4)

id,firstName
11,Billy

The resulting output will be:, (*5)

Array
(
    [id] => 11
    [firstName] => Billy
)

Install

$ composer require bluefrg/parsecsv:dev-master

The Versions

02/11 2016

dev-master

9999999-dev

Extend PHP's native CSV parsing from the SplFileObject class but provide features to use the first row's values as keys on the remaining rows.

  Sources   Download

MIT

The Requires

  • php >=5.1

 

The Development Requires