PHPackages                             alexbrandes/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. [File &amp; Storage](/categories/file-storage)
4. /
5. alexbrandes/simplecsv

ActiveLibrary[File &amp; Storage](/categories/file-storage)

alexbrandes/simplecsv
=====================

Simple and flexible library for reading and manipulating CSV files in PHP.

011PHP

Since Jul 9Pushed 11y ago1 watchersCompare

[ Source](https://github.com/AlexBrandes/simplecsv)[ Packagist](https://packagist.org/packages/alexbrandes/simplecsv)[ RSS](/packages/alexbrandes-simplecsv/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

SimpleCsv
=========

[](#simplecsv)

SimpleCsv is a simple and flexible library for reading and manipulating CSV files.

Usage
-----

[](#usage)

#### Read CSV from File

[](#read-csv-from-file)

```
$csv = \Reader::create_from_file('./dat.csv');
```

#### Read CSV from String

[](#read-csv-from-string)

```
$str = 'header 1, header 2
data 1, data 2';
$csv = \Reader::create_from_string($str);
```

#### CSV to Array

[](#csv-to-array)

```
// 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();
```

#### Detect Delimiter

[](#detect-delimiter)

```
// automatically detect and set the file delimiter type
$csv = \Reader::create_from_file('./dat.csv')
				->detect_delimiter(array('|', '%', '$'))
				->to_assoc();
```

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

[](#installation)

Install the `SimpleCsv` package with Composer.

```
{
    "require": {
        "AlexBrandes/SimpleCsv": "*"
    }
}
```

Read more about [Composer](http://getcomposer.org/doc/01-basic-usage.md)

System Requirements
-------------------

[](#system-requirements)

**PHP &gt;= 5.3.0**

TODO
----

[](#todo)

- Write to Csv
- Tests

#### Credits

[](#credits)

- Written and maintained by [Alex Brandes](https://github.com/alexbrandes)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/44d5d3738e89946e507205edf9391a04e2e731ad33a79dc6ab91a5481d933233?d=identicon)[AlexBrandes](/maintainers/AlexBrandes)

### Embed Badge

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

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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