viossat / arraytotexttable Goto Github PK
View Code? Open in Web Editor NEWPHP library to display arrays as text
License: MIT License
PHP library to display arrays as text
License: MIT License
This is generated:
┌──────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ PO. NUMBER │ ORDER DETAILS │
├──────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ PO 123456789 │ Aenean condimentum viverra tempor. Phasellus quis feugiat
purus. Donec malesuada est id urna ullamcorper, vitae
laoreet nibh lacinia. Nulla nulla velit, maximus vitae
tortor at, placerat efficitur elit. Donec luctus hendrerit
purus ac aliquam. Aenean maximus eros leo, at tempus elit
viverra vel. │
└──────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
When I expect the long next in second column to be wrapped each 60 characters.
Code used:
$data[] = [
'PO. Number' => $order->po_number ?? 'n/a',
'Order Details' => wordwrap($order->order_details, 60) ?? 'n/a', // this is very long text, I want to be wrapped in 60 characters
];
$renderer = new ArrayToTextTable($data);
echo '<pre>' . $renderer->getTable() . '</pre>';
Composer gives the following warnings:
Package zendframework/zend-servicemanager is abandoned, you should avoid using it. Use laminas/laminas-servicemanager instead.
Package zendframework/zend-text is abandoned, you should avoid using it. Use laminas/laminas-text instead.
Thank you for the project. Is this situation correct?
┌───────────┬──────┬──────────────┬──────────┬──────────┬─────────┐
│ SOURCE │ NAME │ TYPE │ NULLABLE │ DEFAULT │ COMMENT │
├───────────┼──────┼──────────────┼──────────┼──────────┼─────────┤
│ DB │ name │ varchar(256) │ false │ │ 姓名 │
│ Migration │ name │ varchar(255) │ false │ 测试注释 │ │
└───────────┴──────┴──────────────┴──────────┴──────────┴─────────┘
┌────────────┬──────┐
│ DAY │ 签到人数 │
├────────────┼──────┤
│ 2018-10-31 │ 632 │
│ 2018-10-30 │ 710 │
│ 2018-10-29 │ 705 │
│ 2018-10-28 │ 605 │
│ 2018-10-27 │ 626 │
│ 2018-10-26 │ 342 │
│ 2018-10-25 │ 214 │
│ 2018-10-24 │ 57 │
│ 2018-10-23 │ 27 │
└────────────┴──────┘
Hi,
The library can't be installed on PHP 8.3.
I will provide a MR for that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.