Is there a de-facto standard library for creating ASCII \"tables\" in PHP?
I want some PHP code that, when handed an array or other data structure will output tabl
This is what you are looking for:
http://code.google.com/p/php-text-table/
While it's not the defacto standard, the Zend_Text_Table component of the Zend Framework does exactly this.
It has the added bonus of being highly configurable and modular; for example it affords you control over all sorts of formatting details. Also, it adheres to strict OOP principals, if that matters to you.
While the fact that it is part of a larger library may be intimidating, the component is fairly decoupled, the only dependency I can see is on the Zend_Loader_PluginLoader
, for its pluggable rendering engine.
Most importantly, it fully supports UTF-8.
Simpler than Zend\Text\Table: https://github.com/viossat/arraytotexttable