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.4k↓64.7%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 today

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

39

—

LowBetter than 84% of packages

Maintenance20

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

812d 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.9k157.3M897](/packages/maatwebsite-excel)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[yajra/laravel-datatables-export

Laravel DataTables Queued Export Plugin.

362.2M4](/packages/yajra-laravel-datatables-export)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k19](/packages/solspace-craft-freeform)

PHPackages © 2026

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