markenwerk/json-pretty-printer
最新稳定版本:1.0.1
Composer 安装命令:
composer require markenwerk/json-pretty-printer
包简介
A PHP library providing pretty printing JSON strings for PHP < 5.4
关键字:
README 文档
README
A PHP library providing pretty printing JSON strings for PHP < 5.4 based upon this StackOverflow answer by Kendall Hopkins.
Installation
{
"require": {
"markenwerk/json-pretty-printer": "~1.0"
}
}
Usage
Autoloading and namesapce
require_once('path/to/vendor/autoload.php');
Pretty printing a JSON string
Default indentation is one tab.
use Markenwerk\JsonPrettyPrinter;
$jsonString = json_encode($myObject);
$prettyPrinter = new JsonPrettyPrinter\JsonPrettyPrinter();
$prettyPrinted = $prettyPrinter
->setIndentationString(' ')
->prettyPrint($jsonString);
Contribution
Contributing to our projects is always very appreciated.
But: please follow the contribution guidelines written down in the CONTRIBUTING.md document.
License
PHP JSON Pretty Printer is under the MIT license.
统计信息
- 总下载量: 2.16k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-12