PHP ASCII Table Library

Is there a de facto standard library for creating ASCII tables in PHP?

I need some kind of PHP code that when passing an array or other data structure displays tables that look something like the mysql client line results

+--------+---------------------+----------------------------------+ | fld_id | fld_name | fld_email | +--------+---------------------+----------------------------------+ | 1 | A value | another value | | 2 | A value | | | 3 | A value | another value | +--------+---------------------+----------------------------------+ 

Not rocket science, or even computer science, but, of course, a tedious science that someone has already decided.

+2
source share
3 answers

Although this is not a defacto standard, the Zend_Text_Table component in the Zend Framework does just that.

It has an added bonus that is very customizable and modular; for example, it allows you to control all kinds of formatting details. In addition, he adheres to strict OOP principles, if that matters to you.

Although the fact that it is part of a larger library can be intimidating, the component is pretty loose, the only dependency I see is on Zend_Loader_PluginLoader for its plugin rendering engine.

Most importantly, it fully supports UTF-8.

+3
source

This is what you are looking for:

http://code.google.com/p/php-text-table/

+4
source

Simpler than Zend \ Text \ Table: https://github.com/viossat/arraytotexttable

+1
source

Source: https://habr.com/ru/post/1340837/


All Articles