guanguans / json-format
Format json string.
Fund package maintenance!
Patreon
www.guanguans.cn/images/wechat.jpeg
Requires
- php: >=5.4
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ~4|~5|~6|~7|~8|~9
README
Format json string.
Requirements
- PHP > 5.4
- ext-json
Installing
$ composer require guanguans/json-format -v
Usage
Code
<?php require __DIR__.'/vendor/autoload.php'; $json = <<<'JSON' {"name":"json-format","keywords":["json","format","pretty"],"description":"Format json string."} JSON; echo json_format($json);
Output
{ "name": "json-format", "keywords": [ "json", "format", "pretty" ], "description": "Format json string." }
Testing
$ composer test