Allows you to pretty-print JSON data in a human-readable format
You can download the Latest release version as a standalone, alternatively you can use Composer for optional dependencies such as PHPUnit.
$ composer require ghostff/json-formatter
Or add:
{
"require": {
"ghostff/json-formatter": "^1.0"
}
}
to your `composer.json
`
Usage:
<?php
$source = array (
array ( 'points' => 1, 'name' => 'Peter'),
array ( 'points' => 5, 'name' => 'Mike'),
array ( 'points' => 2, 'name' => 'John Zoo'),
array ( 'points' => 2, 'name' => 'John Ab')
);
echo Json::encode($source);
Outputs:
Classes of chrys ugwu | > | PHP JSON Pretty Print | > | Download .zip .tar.gz | > | Support forum | > | Blog | > | Latest changes |
|
|
Groups | Applications | Files |
Groups |
HTML | HTML generation and processing | View top rated classes |
PHP 5 | Classes using PHP 5 specific features | View top rated classes |
Data types | Modeling and manipulating data types | View top rated classes |
Innovation Award |
July 2019 Nominee Vote |
Many developers need to check values used in their applications variables. One easy way of seeing those values is to display them on a Web page. Nowadays, many developers prefer to use the JSON format to display application variable values. PHP supports the JSON format but sometimes the output of the JSON encoding functions is not very readable. This class provides a solution to display application variable values using the JSON format in a way that can be more readable for all developers. Manuel Lemos |
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Download all files: json_formatter.tar.gz json_formatter.zip NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
|