PHPackages                             mhndev/csv - 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. mhndev/csv

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

mhndev/csv
==========

library for working with csv

1.3.2(9y ago)7189BSD StylePHPPHP &gt;=5.4.0

Since May 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mhndev/csv)[ Packagist](https://packagist.org/packages/mhndev/csv)[ Docs](http://github.com/mhndev/csv)[ RSS](/packages/mhndev-csv/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

[![Build Status](https://camo.githubusercontent.com/76058bc423faeb3c8b0acfb884ed5faf926cb00dd7562627614fc070b3fdcacf/68747470733a2f2f7472617669732d63692e6f72672f6d686e6465762f6373762e7376673f6272616e63683d312e332e31)](https://travis-ci.org/mhndev/csv)[![Total Downloads](https://camo.githubusercontent.com/92c7c1f15a70da93bd30b30c0a1a2b47891ee2ec437e919df63d80b69105004c/68747470733a2f2f706f7365722e707567782e6f72672f6d686e6465762f6373762f642f746f74616c2e737667)](https://packagist.org/packages/mhndev/csv)[![Latest Stable Version](https://camo.githubusercontent.com/aab47c3a838a0e9549edd7ec985ca6f1980e7c9daf68b60ea2613065770b7202/68747470733a2f2f706f7365722e707567782e6f72672f6d686e6465762f6373762f762f737461626c652e737667)](https://packagist.org/packages/mhndev/csv)[![License](https://camo.githubusercontent.com/6cf852574562a838b55f0f93f99a2ee993c87f2c7b9de898ca78bd644b54824b/68747470733a2f2f706f7365722e707567782e6f72672f6d686e6465762f6373762f6c6963656e73652e737667)](https://packagist.org/packages/mhndev/csv)

CSV
---

[](#csv)

powerful and fully tested php library to work with csv files

### features :

[](#features-)

#### convert an array to a csv file

[](#convert-an-array-to-a-csv-file)

#### convert a csv file to an array

[](#convert-a-csv-file-to-an-array)

#### convert a csv file to an array using php generators

[](#convert-a-csv-file-to-an-array-using-php-generators)

#### delete a line from csv file by line number

[](#delete-a-line-from-csv-file-by-line-number)

#### delete multiple line from csv file by specific column value

[](#delete-multiple-line-from-csv-file-by-specific-column-value)

#### update a line from a csv file by line number

[](#update-a-line-from-a-csv-file-by-line-number)

#### update multiple line from a csv file by specific column value

[](#update-multiple-line-from-a-csv-file-by-specific-column-value)

#### find one line from a csv file by specific column value

[](#find-one-line-from-a-csv-file-by-specific-column-value)

#### find many line from a csv file by specific column value

[](#find-many-line-from-a-csv-file-by-specific-column-value)

Sample Usage
------------

[](#sample-usage)

```
use mhndev\csv\Csv;

$csv = new Csv();
$sampleArray = [[1,2,3,4,5],[6,7,8,9,10]];
$filename ="/path/to/test.csv";
$csv->arrayToCsv($sampleArray, $filename);
$resultArrayIterator = $csv->csvToArrayUsingGenerator($filename);

$csv = new Csv();
$sampleArray = [[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15]];
$filename ="/path/to/test.csv";
$csv->arrayToCsv($sampleArray, $filename);
$csv->deleteOneLineById($filename, 1);

$csv = new Csv();
$sampleArray = [[1,2,3,4,5],[6,7,8,9,10],[6,'hamid',8,9,'majid']];
$filename ="/path/to/test.csv";
$csv->arrayToCsv($sampleArray, $filename);
$csv->updateLineBy($filename, [2=>8] , [11,12,13,14,15]);
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~55 days

Recently: every ~69 days

Total

6

Last Release

3417d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c3e5d182214e2e6b989a2230bcae80b2107b088da1c6dbea6f6f8d28702e272?d=identicon)[majidphpdeveloper](/maintainers/majidphpdeveloper)

---

Top Contributors

[![mhndev](https://avatars.githubusercontent.com/u/5164182?v=4)](https://github.com/mhndev "mhndev (20 commits)")

---

Tags

csvcsv-databasecsv-parsercsv-readercsvcsv to arraycsv librarycsv manipulationparse csv

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mhndev-csv/health.svg)

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k152.8M851](/packages/maatwebsite-excel)[league/csv

CSV data manipulation made easy in PHP

3.5k176.5M798](/packages/league-csv)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k26.3M51](/packages/rap2hpoutre-fast-excel)[openspout/openspout

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

1.2k65.5M210](/packages/openspout-openspout)[goodby/csv

CSV import/export library

9535.6M25](/packages/goodby-csv)[sonata-project/exporter

Lightweight Exporter library

44121.3M38](/packages/sonata-project-exporter)

PHPackages © 2026

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