定制 air-petr/php-tabulator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

air-petr/php-tabulator

Composer 安装命令:

composer require air-petr/php-tabulator

包简介

Tabular data in PHP

README 文档

README

Pretty-print the tabular data in various ways.

Instalation

composer require ar-petr/php-tabulator

Usage

You will get a Tabulator class with a static interface:

use AirPetr\Tabulator;

$body = [
    [1, 'Lila', 'Hevner'],
    [2, 'Florrie', 'Gravie'],
];

$header = ['id', 'first_name', 'last_name'];

echo Tabulator::getPlain($body); // Table without headers
echo Tabulator::getPlain($body, $header); // Table with headers

There are different types of output:

Plain

echo Tabulator::getPlain($data, $headers);

/*
id first_name last_name
 1 Lila       Hevner   
 2 Florrie    Gravie   
*/

Simple

echo Tabulator::getSimple($data, $headers);

/*
id first_name last_name
-- ---------- ---------
 1 Lila       Hevner   
 2 Florrie    Gravie   
*/

GitHub

echo Tabulator::getGitHub($data, $headers);

/*
| id | first_name | last_name |
| -- | ---------- | --------- |
|  1 | Lila       | Hevner    |
|  2 | Florrie    | Gravie    |
*/

More types may be added in the future.

Numbers

Columns with numbers are flushed to the left.

| ip_address      | age  | account  |
| --------------- | ---- | -------- |
| 219.249.38.228  | 2362 | 12276.68 |
| 197.81.54.113   |   41 |  6496.03 |
| 176.111.139.6   |   64 |  3291.72 |
| 208.178.177.206 |   34 |  4311.57 |

Demo

You can see some examples by running scripts from a demo folder:

php demo/plain.php
php demo/github.php
# etc.

Testing

Run tests by:

composer test

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固