PHP code example of hxzlhby / arr2table

1. Go to this page and download the library: Download hxzlhby/arr2table library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hxzlhby / arr2table example snippets


$data = [
    ['单个表格'],
    ['标题1', '标题2', '标题3'],
    [1, 2, 3],
    [1, 2, 3],
    [1, 2, 3]
];
$table = Arr2Table::oneTable($data);
echo $table;

$data2 = [
    [
        ['多个表格1'],
        ['标题1', '标题2', '标题3'],
        [1, 2, 3],
        [1, 2, 3],
        [1, 2, 3]
    ],
    [
        ['多个表格2'],
        ['标题1', '标题2', '标题3'],
        [1, 2, 3],
        [1, 2, 3],
        [1, 2, 3]
    ]
];
$table2 = Arr2Table::moreTable($data2);
echo $table;