{"id":33991222,"url":"https://github.com/imtiazmahbub/array-to-text-php","last_synced_at":"2026-05-28T12:32:46.385Z","repository":{"id":56990638,"uuid":"108745441","full_name":"imtiazmahbub/array-to-text-php","owner":"imtiazmahbub","description":"This PHP class can convert an array into ascii text table.","archived":false,"fork":false,"pushed_at":"2018-08-16T09:46:32.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-14T18:49:47.161Z","etag":null,"topics":["array","php","text-formatting"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imtiazmahbub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-29T15:18:14.000Z","updated_at":"2019-12-05T15:24:15.000Z","dependencies_parsed_at":"2022-08-21T12:20:25.750Z","dependency_job_id":null,"html_url":"https://github.com/imtiazmahbub/array-to-text-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/imtiazmahbub/array-to-text-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtiazmahbub%2Farray-to-text-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtiazmahbub%2Farray-to-text-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtiazmahbub%2Farray-to-text-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtiazmahbub%2Farray-to-text-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imtiazmahbub","download_url":"https://codeload.github.com/imtiazmahbub/array-to-text-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imtiazmahbub%2Farray-to-text-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33609237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","php","text-formatting"],"created_at":"2025-12-13T06:40:50.582Z","updated_at":"2026-05-28T12:32:46.364Z","avatar_url":"https://github.com/imtiazmahbub.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Array to Text Table\n*forked from https://gist.github.com/tony-landis/31477*\n\nThis PHP class can convert an array into ascii text table.\n\n## Example Usage:\n\n```\nrequire_once ('ArrayToTextTable.php');\n\n$data = array(\n\tarray('company'=\u003e'AIG', 'id'=\u003e1, 'balance'=\u003e '-$99,999,999,999.00'),\n\tarray('company'=\u003e'Wachovia', 'id'=\u003e2, 'balance'=\u003e '-$10,000,000.00'),\n\tarray('company'=\u003e'HP', 'id'=\u003e3, 'balance'=\u003e '$555,000.000.00'),\n\tarray('company'=\u003e'IBM', 'id'=\u003e4, 'balance'=\u003e '$12,000.00')\n);\n\n$renderer = new ArrayToTextTable($data);\n$renderer-\u003eshowHeaders(true);\n$renderer-\u003erender();\n```\n### Output of above example\n```\n+----------+----+---------------------+\n| COMPANY  | ID |       BALANCE       |\n+----------+----+---------------------+\n| AIG      | 1  | -$99,999,999,999.00 |\n| Wachovia | 2  | -$10,000,000.00     |\n| HP       | 3  | $555,000.000.00     |\n| IBM      | 4  | $12,000.00          |\n+----------+----+---------------------+\n```\n\n\n## Useful Methods:\n\n#### `render` *default: false*\nYou can catch the output of the render with `render(true)`\n```\n$output = $renderer-\u003erender(true);\n```\n\n#### `showHeaders` *default: false*\nShow the headers using the key values of the array for the titles\n```\n$renderer-\u003eshowHeaders(true);\n```\n\n#### `setMaxWidth` *default: 30*\nSet the maximum width (number of characters) per column before truncating\n```\n$renderer-\u003esetMaxWidth(30);\n```\n\n#### `setMaxHeight` *default: 2*\nSet the maximum height (number of lines) per row before truncating\n```\n$renderer-\u003esetMaxHeight(30);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimtiazmahbub%2Farray-to-text-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimtiazmahbub%2Farray-to-text-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimtiazmahbub%2Farray-to-text-php/lists"}