PHPackages                             digitaldream/data-converter - 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. digitaldream/data-converter

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

digitaldream/data-converter
===========================

In web application we need to convert data from one type to another. For example, array to excel file or excel file to array.

1.3.0(2y ago)69.3k↑50%22MITPHPPHP ^8.2

Since Jun 17Pushed 2y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (1)Versions (6)Used By (2)

data-converter
==============

[](#data-converter)

something in web application we need to convert data from excel file to array, array to excel file and more. ##How to install

```
  "require-dev": {
     "digitaldream/data-converter": "1.0.*"
}
```

\##Features

1. Excel to Array and associative array (if first row marked as heading)
2. Excel to json(json to excel)
3. Excel to text(text to excel)
4. Filter data while import from excel,json,txt,csv
5. And from one format you can exchange other easily

\##Uses

Example 01

```
$fileManager = new \DataConverter\FileExcel();
```

A lot of other configuration like you can define from which row you like to read and how many row it will be read. Also you can append data to file.

```
  $config = [
    'file_path' => 'C:\Users\Tuhin\Downloads\apiv1567623ccbcfc1_570a009e10650.xlsx',
    'first_row_as_headline' => true,
  ];

  $data = $fileManager->config($config)->read()->getData();
  //$data = $fileManager->config($config)->read()->toJson();
  //$data = $fileManager->config($config)->read()->toText();
  //$data = $fileManager->config($config)->read()->toAssoc();
  print_r($data);
  ?>
```

Example 02

```
//Here it will process the file based on file mimetype.

$fileFullPath='test.txt';

  $fileManager = \DataConverter\FileManager::initByFileType($fileFullPath);

if ($fileManager === FALSE) {
 // exit() File tye does not mathch
 }

 //here we used filter. It will take only these two columns value and other data from the souce will be ignored.

 $data = $fileManager->config($config)->read()->makeAssoc()->filter(['column_1','column_2])->getData();
```

Example 03

```
 $fileManager = new \DataConverter\FileExcel();
 $configFile = [
     'file_path' => $fullPath,// full file path where file will be saved.
       'data' => $data,//data as associative array.
       'mode' => 'w+'//only valid if file type is txt
    ];
  $fileManager = $fileManager->config($configFile)->filter(['column 1','column 2'])->write(true);
```

**More examples is in demo/exmaples.php file**

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity79

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

Total

5

Last Release

755d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

1.3.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6059541?v=4)[Tuhin Bepari](/maintainers/digitaldreams)[@digitaldreams](https://github.com/digitaldreams)

---

Top Contributors

[![digitaldreams](https://avatars.githubusercontent.com/u/6059541?v=4)](https://github.com/digitaldreams "digitaldreams (46 commits)")

---

Tags

excelphpphpexcelphpofficeExcel to ArrayArray to excel

### Embed Badge

![Health badge](/badges/digitaldream-data-converter/health.svg)

```
[![Health](https://phpackages.com/badges/digitaldream-data-converter/health.svg)](https://phpackages.com/packages/digitaldream-data-converter)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M708](/packages/maatwebsite-excel)[phpoffice/phppresentation

PHPPresentation - Read, Create and Write Presentations documents in PHP

1.4k2.4M25](/packages/phpoffice-phppresentation)[kartik-v/yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)

1623.1M35](/packages/kartik-v-yii2-export)[moonlandsoft/yii2-phpexcel

Exporting PHP to Excel or Importing Excel to PHP

1491.1M16](/packages/moonlandsoft-yii2-phpexcel)[yidas/phpspreadsheet-helper

PHP Excel Helper - Write and read Spreadsheet with easy way based on PhpSpreadsheet

383144.5k3](/packages/yidas-phpspreadsheet-helper)[yectep/phpspreadsheet-bundle

A Symfony bundle to integrate with PHPOffice's PhpSpreadsheet library

562.3M3](/packages/yectep-phpspreadsheet-bundle)

PHPackages © 2026

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