Download the PHP package simpl/csv without Composer
On this page you can find all versions of the php package simpl/csv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package csv
Short Description Makes reading CSV files Simpl!
License MIT
Homepage https://github.com/simple-php/csv
Informations about the package csv
Simpl/Csv
Reading delimited files... the Simpl way!
Why should you use this? We already have fgetcsv()
.
Yes, fgetcsv()
is great, and this package uses it under the hood - with some quality of life improvements.
The main benefits of this package are:
- Easy to set number of records to skip (like headings)
- You can give it an array of column headings and it will return the parsed row as an associative array.
- This means you get to work with array keys you define instead of having to remember the numerical position.
- This provides some basic transformations out of the box.
- Automatically trim all values.
- Automatically convert empty strings to
null
.
- If you provide column headings, it will compare the number of column headings to the number of columns it parsed from each row and throw an exception if your data is missing a column.
- Return the full CSV as an array or json object.
Installation
Basic Usage
See https://simpl-php.com/components/csv for full documentation.
Testing
Coding Standards
This library uses PHP_CodeSniffer to ensure coding standards are followed.
I have adopted the PHP FIG PSR-2 Coding Standard EXCEPT for the tabs vs spaces for indentation rule. PSR-2 says 4 spaces. I use tabs. No discussion.
To support indenting with tabs, I've defined a custom PSR-2 ruleset that extends the standard PSR-2 ruleset used by PHP_CodeSniffer. You can find this ruleset in the root of this project at PSR2Tabs.xml
Codesniffer
Codefixer
All versions of csv with dependencies
ext-json Version *