emanuelecoppola/smartwrap
Composer 安装命令:
composer require emanuelecoppola/smartwrap
包简介
Smarter wordwrap for PHP
README 文档
README
I wrote this package because I faced the same problem as in this StackOverflow question.
Installation
composer require emanuelecoppola/smartwrap
Usage
use EmanueleCoppola\SmartWrap\SmartWrap; $sw = new SmartWrap(); $wrapped = $sw->smartwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true); print($wrapped); // Or by using the global function $wrapped = smartwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true); print($wrapped);
Sample input/output
$output = wordwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true); // The output will be ↓ $output == "hello!\nheeeeeeeeeeeeeeereis\naverylongword"; $output = smartwrap('hello! heeeeeeeeeeeeeeereisaverylongword', 20, "\n", true); // The output will be ↓ $output == "hello! heeeeeeeeeeee\neeereisaverylongword";
统计信息
- 总下载量: 63
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-31