PHPackages                             licvido/array-to-table - 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. licvido/array-to-table

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

licvido/array-to-table
======================

PHP array of objects to table.

v1.0.0(3y ago)011MITPHPPHP &gt;=8.0

Since Feb 25Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![Header image](docs/header-image.png)](docs/header-image.png)

PHP array to table
==================

[](#php-array-to-table)

Converts a PHP array of objects/arrays to a summary table. Useful for debugging and examining data.

```
echo array_to_table($array);
```

Requirements
------------

[](#requirements)

Package requires PHP 8.0 or higher.

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

[](#installation)

The best way to install package is using [Composer](http://getcomposer.org/):

```
$ composer require licvido/array-to-table
```

Or simply copy the `array_to_table()` function from `src/array_to_table.php` into your project.

Usage
-----

[](#usage)

Pass an array of objects, arrays, or values to the `array_to_table()` function and print result.

```
// array of values
$array = ['lorem', 'ipsum', 3, 4, 5, 'dolor', 7];

// or array of arrays without keys
$array = [
	[1, 2],
	[1, 2, 3],
	[1, 4, 3],
	[5, 6],
];

// or array of arrays with keys and values
$array = [
	['A' => 1, 'B' => 2],
	['A' => 3, 'B' => 4],
	['A' => 5, 'B' => 6, 'C' => 7, 'D' => 8],
	['E' => 9, 'F' => 0],
];

// or array of objects
$array = [
	(object) ['A' => 1, 'B' => 2],
	(object) ['A' => 3, 'B' => 4],
	(object) ['A' => 5, 'B' => 6, 'C' => 7, 'D' => 8],
	(object) ['E' => 9, 'F' => 0],
];

// or array of mixed arrays and objects
$array = [
	['A' => 1, 'B' => 2],
	(object) ['A' => 3, 'B' => 4],
	['A' => 5, 'B' => 6, 'C' => 7, 'D' => 8],
	(object) ['E' => 9, 'F' => 0],
];

// or array of objects from json
$dummyData = json_decode(file_get_contents('https://dummyjson.com/users'));
$array = $dummyData->users;

// print table
echo array_to_table($array);
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

This library is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6e58770abacabbf4fb204ce5af10762fe7bdecec2524c306260491f85a7bd1a?d=identicon)[licvido](/maintainers/licvido)

---

Top Contributors

[![licvido](https://avatars.githubusercontent.com/u/564821?v=4)](https://github.com/licvido "licvido (2 commits)")

---

Tags

arrayarray-to-tablephp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/licvido-array-to-table/health.svg)

```
[![Health](https://phpackages.com/badges/licvido-array-to-table/health.svg)](https://phpackages.com/packages/licvido-array-to-table)
```

PHPackages © 2026

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