diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4f4acd3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor/ +composer.lock \ No newline at end of file diff --git a/README.md b/README.md index 17536ea..2f0197e 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ # parseCSV -_Note: I am no longer actively working on this library, but please submit pull -requests for any fixes/features you would like to see added._ +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. -parseCSV is an easy to use PHP class to read and write CSV data properly. It +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][CSV]. It has a few advanced features which help make your +[Wikipedia article][CSV]. It has many advanced features which help make your life easier when dealing with CSV data. -I originally created this library in early 2007 due to the lack of built-in +This library was originaly created in early 2007 by [jimeh](https://github.com/jimeh) due to the lack of built-in and third-party support for handling CSV data in PHP. [csv]: http://en.wikipedia.org/wiki/Comma-separated_values @@ -17,7 +16,7 @@ and third-party support for handling CSV data in PHP. ## Features * parseCSV is the only complete and fully featured CSV solution for PHP (as - far as i know). + far as I know). * Supports enclosed values, enclosed commas, double quotes and new lines. * Automatic delimiter character detection. * Sort data by specific fields/columns. @@ -84,7 +83,7 @@ a file and download it** ```php $csv = new parseCSV(); -$csv->output(true, 'movies.csv', $array); +$csv->output('movies.csv', $array, array('field 1', 'field 2'), ','); ``` diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..7c2625f --- /dev/null +++ b/composer.json @@ -0,0 +1,17 @@ +{ + "name": "parsecsv/php-parsecsv", + "description": "CSV data parser for PHP", + "license": "MIT", + "authors": [ + { + "name": "Jim Mygrberg", + "email": "contact@jimeh.me" + } + ], + "autoload": { + "classmap": ["."] + }, + "require-dev": { + "phpunit/phpunit": "4.1.*" + } +} diff --git a/parsecsv.lib.php b/parsecsv.lib.php index badc945..7a6d8f9 100644 --- a/parsecsv.lib.php +++ b/parsecsv.lib.php @@ -70,7 +70,7 @@ class parseCSV { # convert 2D array to csv data and send headers # to browser to treat output as a file and download it $csv = new parseCSV(); - $csv->output (true, 'movies.csv', $array); + $csv->output('movies.csv', $array, array('field 1', 'field 2'), ','); ---------------- */