PHPackages                             mehr-it/data-interchange-format - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mehr-it/data-interchange-format

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mehr-it/data-interchange-format
===============================

Data interchange format (DIF) writer

1.0.1(6y ago)0106↓50%[1 PRs](https://github.com/mehr-it/data-interchange-format/pulls)MITPHPPHP &gt;=7.2.0CI passing

Since Jan 20Pushed 3mo agoCompare

[ Source](https://github.com/mehr-it/data-interchange-format)[ Packagist](https://packagist.org/packages/mehr-it/data-interchange-format)[ RSS](/packages/mehr-it-data-interchange-format/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

PHP Data interchange format writer (DIF)
========================================

[](#php-data-interchange-format-writer-dif)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b50b98c05ca5cbce94bc497a8da8397d9b0a029c55893b268bc6df88fb1e2250/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6568722d69742f646174612d696e7465726368616e67652d666f726d61742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mehr-it/data-interchange-format)[![Build Status](https://camo.githubusercontent.com/2bedbdebb512aab5776e6df4ea97836dfea93689d802132801cf60974edc4829/68747470733a2f2f7472617669732d63692e6f72672f6d6568722d69742f646174612d696e7465726368616e67652d666f726d61742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mehr-it/data-interchange-format)

This package implements a simple [data interchange format (DIF)](https://en.wikipedia.org/wiki/Data_Interchange_Format) writer.

Usage
-----

[](#usage)

To create a DIF file, columns with data types have to be specified and the data has to be passed as array to the writer:

```
(new DifWriter())
    ->columns([
        'Text'   => DifWriter::TYPE_STRING,
        'Number' => DifWriter::TYPE_NUMERIC,
    ])
    ->data([
        [
            'Text'   => 'hello',
            'Number' => 1,
        ],
        [
            'Text'   => 'this is me',
            'Number' => -3.5,
        ],
    ])
    ->writeTo($target)

```

Input/output encoding may be specified as well as the linebreak to use using the corresponding setter functions of the writer class.

By default the column headers are output as first line. To disable column header output, simply pass `false` as second argument to the `columns()` method:

```
$writer->columns([
            'Text'   => DifWriter::TYPE_STRING,
            'Number' => DifWriter::TYPE_NUMERIC,
        ], false);

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance53

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2311d ago

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

1.0.1PHP &gt;=7.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44973729?v=4)[mehr.IT GmbH](/maintainers/mehr-it)[@mehr-it](https://github.com/mehr-it)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mehr-it-data-interchange-format/health.svg)

```
[![Health](https://phpackages.com/badges/mehr-it-data-interchange-format/health.svg)](https://phpackages.com/packages/mehr-it-data-interchange-format)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[laragraph/utils

Utilities for using GraphQL with Laravel

2113.8M7](/packages/laragraph-utils)[thenextweb/passgenerator

A Laravel package to create Apple Wallet (old Passbook) compatible tickets.

297435.6k](/packages/thenextweb-passgenerator)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[wyrihaximus/html-compress

Compress/minify your HTML

841.6M31](/packages/wyrihaximus-html-compress)[keepsuit/laravel-temporal

Laravel temporal.io

4875.0k](/packages/keepsuit-laravel-temporal)

PHPackages © 2026

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