PHPackages                             onlinesid/php-data-tabulator - 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. onlinesid/php-data-tabulator

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

onlinesid/php-data-tabulator
============================

A PHP library to transform rows into an aggregated table

1.0.5(8y ago)139.9k↓50%1MITPHPPHP &gt;=5.6.0

Since Apr 25Pushed 8y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (1)Versions (7)Used By (0)

php-data-tabulator
==================

[](#php-data-tabulator)

A PHP library to turn rows of data (e.g.: from database query result) into aggregated tabular data format

Installation
------------

[](#installation)

### Library

[](#library)

```
$ git clone https://github.com/onlinesid/php-data-tabulator.git

```

### Dependencies

[](#dependencies)

#### [`Composer`](https://github.com/composer/composer) (*will use the Composer ClassLoader*)

[](#composer-will-use-the-composer-classloader)

```
$ wget http://getcomposer.org/composer.phar
$ php composer.phar require onlinesid/php-data-tabulator

```

Usage
-----

[](#usage)

```
$rows = [
    ['id' => 7, 'u_id' => 1, 'u_name' => 'Joan', 'a_id' => 'PK', 'a_name' => 'Packing', 'num' => 10.5, ],
    ['id' => 4, 'u_id' => 1, 'u_name' => 'Joan', 'a_id' => 'PK', 'a_name' => 'Packing', 'num' =>  0.5, ],
    ['id' => 2, 'u_id' => 1, 'u_name' => 'Joan', 'a_id' => 'DR', 'a_name' => 'Driving', 'num' =>  2.3, ],
    ['id' => 5, 'u_id' => 2, 'u_name' => 'Robb', 'a_id' => 'DR', 'a_name' => 'Driving', 'num' =>  8.7, ],
];
$tabulator = new DataTabulator($rows);

$table = $tabulator->to2DTable('Name', 'u_id', 'u_name', 'a_id', 'a_name', 'num');

// Expected result ($table) is something like:
//
//    Name       Packing (PK)     Driving (DR)
//    Joan (1)          11               2.3
//    Robb (2)           0               8.7

// Get array with columns ordering
$arr = $table->toArray(true, false, ['DR', 'PK',]);

// Expected result ($arr) is something like:
//
//    Name       Driving (DR)     Packing (PK)
//    Joan (1)          2.3              11
//    Robb (2)          8.7               0

```

Running the tests
-----------------

[](#running-the-tests)

```
$ php bin/phpunit

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community8

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

Total

6

Last Release

2945d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8938cbf4c5b34440ebf00efd7786f01134da5e6820fe1631bd11020bb2e5df5b?d=identicon)[onlinesid](/maintainers/onlinesid)

---

Top Contributors

[![onlinesid](https://avatars.githubusercontent.com/u/99542?v=4)](https://github.com/onlinesid "onlinesid (9 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/onlinesid-php-data-tabulator/health.svg)

```
[![Health](https://phpackages.com/badges/onlinesid-php-data-tabulator/health.svg)](https://phpackages.com/packages/onlinesid-php-data-tabulator)
```

###  Alternatives

[zendexperts/ze-theme

ZeTheme is a Zend Framework 2 module that allows you to switch between various themes. The module does not contain any themes, but you can create your own.

2614.3k1](/packages/zendexperts-ze-theme)

PHPackages © 2026

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