PHPackages                             imtiazmahbub/array-to-text-php - 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. imtiazmahbub/array-to-text-php

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

imtiazmahbub/array-to-text-php
==============================

This PHP class can convert an array into ascii text formatted table

v1.0.2(7y ago)1991MITPHPPHP ^5.3.3 || ^7.0

Since Nov 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/imtiazmahbub/array-to-text-php)[ Packagist](https://packagist.org/packages/imtiazmahbub/array-to-text-php)[ RSS](/packages/imtiazmahbub-array-to-text-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)DependenciesVersions (3)Used By (0)

Array to Text Table
===================

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

*forked from *

This PHP class can convert an array into ascii text table.

Example Usage:
--------------

[](#example-usage)

```
require_once ('ArrayToTextTable.php');

$data = array(
	array('company'=>'AIG', 'id'=>1, 'balance'=> '-$99,999,999,999.00'),
	array('company'=>'Wachovia', 'id'=>2, 'balance'=> '-$10,000,000.00'),
	array('company'=>'HP', 'id'=>3, 'balance'=> '$555,000.000.00'),
	array('company'=>'IBM', 'id'=>4, 'balance'=> '$12,000.00')
);

$renderer = new ArrayToTextTable($data);
$renderer->showHeaders(true);
$renderer->render();

```

### Output of above example

[](#output-of-above-example)

```
+----------+----+---------------------+
| COMPANY  | ID |       BALANCE       |
+----------+----+---------------------+
| AIG      | 1  | -$99,999,999,999.00 |
| Wachovia | 2  | -$10,000,000.00     |
| HP       | 3  | $555,000.000.00     |
| IBM      | 4  | $12,000.00          |
+----------+----+---------------------+

```

Useful Methods:
---------------

[](#useful-methods)

#### `render` *default: false*

[](#render-default-false)

You can catch the output of the render with `render(true)`

```
$output = $renderer->render(true);

```

#### `showHeaders` *default: false*

[](#showheaders-default-false)

Show the headers using the key values of the array for the titles

```
$renderer->showHeaders(true);

```

#### `setMaxWidth` *default: 30*

[](#setmaxwidth-default-30)

Set the maximum width (number of characters) per column before truncating

```
$renderer->setMaxWidth(30);

```

#### `setMaxHeight` *default: 2*

[](#setmaxheight-default-2)

Set the maximum height (number of lines) per row before truncating

```
$renderer->setMaxHeight(30);

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Every ~272 days

Total

2

Last Release

2833d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c7bd12bcf3bc925ddb021655faf0b41be58ef0d772cf7a006fa437ba5974791?d=identicon)[imtiazmahbub](/maintainers/imtiazmahbub)

---

Top Contributors

[![imtiazmahbub](https://avatars.githubusercontent.com/u/7385976?v=4)](https://github.com/imtiazmahbub "imtiazmahbub (8 commits)")

---

Tags

arrayphptext-formatting

### Embed Badge

![Health badge](/badges/imtiazmahbub-array-to-text-php/health.svg)

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

###  Alternatives

[react/zmq

ZeroMQ bindings for React.

2471.7M31](/packages/react-zmq)[jimmiw/php-time-ago

Simple module, that displays the date in a "time ago" format

2611.1M14](/packages/jimmiw-php-time-ago)[donatello-za/rake-php-plus

Yet another PHP implementation of the Rapid Automatic Keyword Extraction algorithm (RAKE).

271865.1k10](/packages/donatello-za-rake-php-plus)

PHPackages © 2026

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