dev-master
9999999-devSimple and flexible library for reading and manipulating CSV files in PHP.
MIT
The Requires
- php >=5.3.0
by Alex Brandes
csv read write php export import
Simple and flexible library for reading and manipulating CSV files in PHP.
SimpleCsv is a simple and flexible library for reading and manipulating CSV files., (*1)
$csv = \Reader::create_from_file('./dat.csv');
$str = 'header 1, header 2 data 1, data 2'; $csv = \Reader::create_from_string($str);
// 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();
// automatically detect and set the file delimiter type $csv = \Reader::create_from_file('./dat.csv') ->detect_delimiter(array('|', '%', '$')) ->to_assoc();
Install the SimpleCsv
package with Composer., (*2)
{ "require": { "AlexBrandes/SimpleCsv": "*" } }
Read more about Composer, (*3)
PHP >= 5.3.0, (*4)
Simple and flexible library for reading and manipulating CSV files in PHP.
MIT
csv read write php export import