fgendorf / php-array-table
PHP Library for printing associative arrays as text table (similar to mysql terminal console) with compatibility with markdown
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 5
pkg:composer/fgendorf/php-array-table
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2025-10-24 05:27:24 UTC
README
PHP-class, which allows to transform php associative arrays to cool ASCII tables.
Installation
Simply run composer require:
composer require fgendorf/php-array-table
or add to composer.json:
"fgendorf/php-array-table": "1.0"
Usage
<?php
use dekor\ArrayToTextTable;
$data = [
[
'id' => 1,
'name' => 'Denis Koronets',
'role' => 'php developer',
],
[
'id' => 2,
'name' => 'Maxim Ambroskin',
'role' => 'java developer',
],
[
'id' => 3,
'name' => 'Andrew Sikorsky',
'role' => 'php developer',
]
];
echo (new ArrayToTextTable($data))->render();
Will draw the next output, compliance with markdown:
| id | name | role | |----|-----------------|----------------| | 1 | Denis Koronets | php developer | | 2 | Maxim Ambroskin | java developer | | 3 | Andrew Sikorsky | php developer |
Made with ❤ by denis