2017 © Pedro Peláez
 

library simplecsv

Simple and flexible library for reading and manipulating CSV files in PHP.

image

alexbrandes/simplecsv

Simple and flexible library for reading and manipulating CSV files in PHP.

  • Wednesday, July 9, 2014
  • by AlexBrandes
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SimpleCsv

SimpleCsv is a simple and flexible library for reading and manipulating CSV files., (*1)

Usage

Read CSV from File

$csv = \Reader::create_from_file('./dat.csv');

Read CSV from String

$str = 'header 1, header 2
data 1, data 2';
$csv = \Reader::create_from_string($str);

CSV to Array

// associative array using first line as headers
$csv = \Reader::create_from_file('./dat.csv')
                ->to_assoc();

// indexed array w/ no headers
$csv = \Reader::create_from_file('./dat.csv')
                ->to_array();

Detect Delimiter

// automatically detect and set the file delimiter type
$csv = \Reader::create_from_file('./dat.csv')
                ->detect_delimiter(array('|', '%', '$'))
                ->to_assoc();

Installation

Install the SimpleCsv package with Composer., (*2)

{
    "require": {
        "AlexBrandes/SimpleCsv": "*"
    }
}

Read more about Composer, (*3)

System Requirements

PHP >= 5.3.0, (*4)

TODO

  • Write to Csv
  • Tests

Credits

The Versions

09/07 2014

dev-master

9999999-dev

Simple and flexible library for reading and manipulating CSV files in PHP.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

csv read write php export import