dev-master
9999999-devCSV data parser for PHP
MIT
The Development Requires
by Jim Myhrberg
v1.0
1.0.0.0CSV data parser for PHP, from https://github.com/jimeh/php-parsecsv
MIT
by Craig Morris
Wallogit.com
2017 © Pedro Peláez
CSV data parser for PHP
Note: parseCSV is now being revised to PHP 5 standards. If you have an issue or a feature request we encourage you to open an issue., (*1)
parseCSV is an easy to use PHP class that reads and writes CSV data properly. It fully conforms to the specifications outlined on the on the Wikipedia article. It has many advanced features which help make your life easier when dealing with CSV data., (*2)
This library was originaly created in early 2007 by jimeh due to the lack of built-in and third-party support for handling CSV data in PHP., (*3)
General, (*4)
$csv = new parseCSV('data.csv');
print_r($csv->data);
Tab delimited, and encoding conversion, (*5)
$csv = new parseCSV();
$csv->encoding('UTF-16', 'UTF-8');
$csv->delimiter = "\t";
$csv->parse('data.tsv');
print_r($csv->data);
Auto-detect delimiter character, (*6)
$csv = new parseCSV();
$csv->auto('data.csv');
print_r($csv->data);
Modify data in a CSV file, (*7)
$csv = new parseCSV();
$csv->sort_by = 'id';
$csv->parse('data.csv');
# "4" is the value of the "id" column of the CSV row
$csv->data[4] = array('firstname' => 'John', 'lastname' => 'Doe', 'email' => 'john@doe.com');
$csv->save();
Add row/entry to end of CSV file, (*8)
Only recommended when you know the extact sctructure of the file., (*9)
$csv = new parseCSV();
$csv->save('data.csv', array('1986', 'Home', 'Nowhere', ''), true);
Convert 2D array to csv data and send headers to browser to treat output as a file and download it, (*10)
$csv = new parseCSV();
$csv->output('movies.csv', $array, array('field 1', 'field 2'), ',');
Please find a complete list on the project's contributors page., (*11)
(The MIT license), (*12)
Copyright (c) 2014 Jim Myhrberg., (*13)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*14)
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*15)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*16)
CSV data parser for PHP
MIT
CSV data parser for PHP, from https://github.com/jimeh/php-parsecsv
MIT