PHPackages                             shuchkin/simplecsv - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. shuchkin/simplecsv

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

shuchkin/simplecsv
==================

Parse and retrieve data from CSV files. Export data to CSV.

1.0.1(2y ago)5192.4k↓19.1%15[5 issues](https://github.com/shuchkin/simplecsv/issues)MITPHP

Since Dec 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/shuchkin/simplecsv)[ Packagist](https://packagist.org/packages/shuchkin/simplecsv)[ Docs](https://github.com/shuchkin/simplecsv)[ RSS](/packages/shuchkin-simplecsv/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

SimpleCSV class 1.0
===================

[](#simplecsv-class-10)

[![](https://camo.githubusercontent.com/a74c2e80186aee7eddc0a18a65b9ad6a2bc557032c6815163361f100714c92bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73687563686b696e2f73696d706c65637376)](https://packagist.org/packages/shuchkin/simplecsv)[![](https://camo.githubusercontent.com/42fde635d1ea2010f4d1cba7f31066723e8fb3cb3ded6232572d4a7911e7fb76/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73687563686b696e2f73696d706c65637376)](https://github.com/shuchkin/simplecsv/blob/master/license.md) [![](https://camo.githubusercontent.com/008ebcf0b4dce99d586ba9688f310a5cc65d0a9d6c75fbc1424fbcbf840cf38d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f73687563686b696e2f73696d706c65637376)](https://github.com/shuchkin/simplecsv/stargazers) [![](https://camo.githubusercontent.com/4b63328d165839db7ed33059135e94d5b6b3c20e4e951c4ac6c7ee797aa6cb25/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f73687563686b696e2f73696d706c65637376)](https://github.com/shuchkin/simplecsv/network) [![](https://camo.githubusercontent.com/e52bfe001b14451ed706e1966918d28ec52e2b603cef4c26ed6c39027f6f3acf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f73687563686b696e2f73696d706c65637376)](https://github.com/shuchkin/simplecsv/issues)[![](https://camo.githubusercontent.com/14840ac5403b9b48a75934a8854b4af0395fc02ca81cba785f59c917da7bd6a9/68747470733a2f2f696d672e736869656c64732e696f2f6f70656e636f6c6c6563746976652f616c6c2f73696d706c65786c7378)](https://opencollective.com/simplexlsx)[![](https://camo.githubusercontent.com/85dc276f8d369fd3a0ac966e5207c3ff902db1139e82560aac480bd0ac871c90/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d5f2d5f)](https://www.patreon.com/shuchkin)

Parse and retrieve data from CSV files. Save array to CSV file. See XLSX reader [here](https://github.com/shuchkin/simplexlsx), XLS reader [here](https://github.com/shuchkin/simplexls),

**Sergey Shuchkin**  2015-2023

Basic Usage
-----------

[](#basic-usage)

```
if ( $csv = Shuchkin\SimpleCSV::parse('book.csv') ) {
	print_r( $csv->rows() );
}
```

```
Array
(
    [0] => Array
        (
            [0] => ISBN
            [1] => title
            [2] => author
            [3] => publisher
            [4] => ctry
        )

    [1] => Array
        (
            [0] => 618260307
            [1] => The Hobbit
            [2] => J. R. R. Tolkien
            [3] => Houghton Mifflin
            [4] => USA
        )

)

```

Installation
------------

[](#installation)

The recommended way to install this library is [through Composer](https://getcomposer.org). [New to Composer?](https://getcomposer.org/doc/00-intro.md)

This will install the latest supported version:

```
$ composer require shuchkin/simplecsv
```

or download class [here](https://github.com/shuchkin/simplecsv/blob/master/src/SimpleCSV.php)

### Debug

[](#debug)

```
ini_set('error_reporting', E_ALL );
ini_set('display_errors', 1 );

$csv = Shuchkin\SimpleCSV::import('books.csv');
print_r( $csv->rows() );
```

### Export

[](#export)

```
$items = [
	['ISBN', 'title', 'author'],
	['618260307','The Hobbit','J. R. R. Tolkien']
];
$csv = Shuchkin\SimpleCSV::export( $items );
echo '' . $csv . '';
/*
ISBN,title,author
618260307,The Hobbit,J. R. R. Tolkien
*/
```

History
-------

[](#history)

1.0 (2023-08-27)

- used namespace now: Shuchkin\\SimpleCSV
- fixed delimiter detection

0.2 (2023-07-27)

- fix 8x deprication [Passing null to parametr](https://github.com/shuchkin/simplecsv/issues/5)
- added static methods SimpleCSV::parse, SimpleCSV::parseFile, SimpleCSV::parseData

0.1.1 (2021-04-28) fix 7.4 deprication [error](https://github.com/shuchkin/simplecsv/issues/1)
0.1 (2018-12-20) GitHub realese, composer

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~288 days

Recently: every ~232 days

Total

6

Last Release

916d ago

Major Versions

0.2.x-dev → 1.02023-08-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/551f9169d9efadfa85ff5ff512eab17e9219ba10e42636d9a31f1021a1027395?d=identicon)[shuchkin](/maintainers/shuchkin)

---

Top Contributors

[![shuchkin](https://avatars.githubusercontent.com/u/315872?v=4)](https://github.com/shuchkin "shuchkin (12 commits)")[![iKlsR](https://avatars.githubusercontent.com/u/741363?v=4)](https://github.com/iKlsR "iKlsR (1 commits)")

---

Tags

phpparserexportexcelcsvimportreadwritebackend

### Embed Badge

![Health badge](/badges/shuchkin-simplecsv/health.svg)

```
[![Health](https://phpackages.com/badges/shuchkin-simplecsv/health.svg)](https://phpackages.com/packages/shuchkin-simplecsv)
```

###  Alternatives

[league/csv

CSV data manipulation made easy in PHP

3.5k166.1M646](/packages/league-csv)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.2k57.6M131](/packages/openspout-openspout)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
