PHPackages                             tomk79/csv2json - 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. tomk79/csv2json

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

tomk79/csv2json
===============

CSVを読み込んで、連想配列構造に変換する。それをJSONに出力する。

1.0.1(3y ago)0303MITPHPPHP &gt;=5.3.0

Since Jan 28Pushed 3y ago1 watchersCompare

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

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

csv2json
========

[](#csv2json)

CSVを読み込んで、連想配列構造に変換します。 連想配列からJSONを出力できます。

導入 - Setup
----------

[](#導入---setup)

composer.json の require 項目に、`tomk79/csv2json` を追加します。

```
{
    "require": {
        "tomk79/csv2json": "1.*"
    }
}

```

`$ composer install` で、インストールを実行します。

あとは、Composer のマニュアルを参考に、`autoload.php` を `require_once()` すれば、セットアップは完了です。

使い方 - Usage
-----------

[](#使い方---usage)

```
$csv2json = new \tomk79\csv2json( 'path/to/data.csv' );
var_dump( $csv2json->fetch_assoc() ); // 連想配列で受け取る
var_dump( $csv2json->to_json() ); // JSON形式の文字列で受け取る
```

CSVファイルの最初の行(0行目)が定義行として使用されます。

更新履歴 - Change log
-----------------

[](#更新履歴---change-log)

### csv2json v1.0.1 (2023年2月5日)

[](#csv2json-v101-2023年2月5日)

- 内部コードの細かい修正。

### csv2json v1.0.0 (2015年1月28日)

[](#csv2json-v100-2015年1月28日)

- Initial Release.

ライセンス - License
---------------

[](#ライセンス---license)

MIT License

作者 - Author
-----------

[](#作者---author)

- (C)Tomoya Koyanagi
- website:
- Twitter: @tomk79

for Developer
-------------

[](#for-developer)

### Test

[](#test)

```
$ ./vendor/phpunit/phpunit/phpunit
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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 ~1465 days

Total

3

Last Release

1199d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00ca3b0b7c69b5a8c25bbfb82b305ab94c4fc7458b38df445cbb97acc073875f?d=identicon)[tomk79](/maintainers/tomk79)

---

Top Contributors

[![tomk79](https://avatars.githubusercontent.com/u/584845?v=4)](https://github.com/tomk79 "tomk79 (5 commits)")

---

Tags

csv

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tomk79-csv2json/health.svg)

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[league/csv

CSV data manipulation made easy in PHP

3.5k166.1M646](/packages/league-csv)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/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.1k57.6M131](/packages/openspout-openspout)[goodby/csv

CSV import/export library

9555.6M23](/packages/goodby-csv)[sonata-project/exporter

Lightweight Exporter library

44920.9M35](/packages/sonata-project-exporter)

PHPackages © 2026

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