https://github.com/dtinth/json_pretty
Pretty-print your JSON!
https://github.com/dtinth/json_pretty
php
Last synced: 3 months ago
JSON representation
Pretty-print your JSON!
- Host: GitHub
- URL: https://github.com/dtinth/json_pretty
- Owner: dtinth
- Created: 2011-05-03T15:15:26.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2011-05-03T15:26:06.000Z (over 14 years ago)
- Last Synced: 2024-05-02T06:07:13.903Z (over 1 year ago)
- Topics: php
- Language: PHP
- Homepage:
- Size: 93.8 KB
- Stars: 9
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
json_pretty
===========
A JSON pretty-printer for PHP. Usage:
echo json_pretty(json_encode($data));
The output style of this function is highly configurable. There are 2 built-in styles included. See the source.
Example
-------
An example of prettyprinted JSON:
{ "updated": 1304434891,
"crews": [
{ "rank": 1,
"previousRanks": [ 11, 323 ],
"emblemPlate": { "id": "816833289" },
"emblemPattern": { "id": "1353236320" },
"name": "BBG-RM3",
"points": 1517,
"course": {
"stages": [
{ "pattern": "cosmicfantastic_3",
"effects": { "fade": "-", "line": "-", "scroll": "-" } },
{ "pattern": "supersonicrmx_3",
"effects": { "fade": "-", "line": "-", "scroll": "-" } },
{ "pattern": "someday_3",
"effects": { "fade": "-", "line": "-", "scroll": "-" } } ],
"producer": "BOAT",
"plays": 21,
"wins": 17 } } ],
"round": 19 }
Looks nice don't you think?