PHP Classes
elePHPant
Icontem

PHP JSON Pretty Print: Display data types like human-readable JSON values

Recommend this page to a friend!

  Author Author  
Name: chrys ugwu <contact>
Classes: 4 packages by
Country: Nigeria Nigeria
Innovation award
Innovation award
Nominee: 3x


  Detailed description   Download Download .zip .tar.gz  
This class can display data types like human-readable JSON values.

It takes the a variable value as parameter and encodes it as JSON object.

The class processes the JSON output and reformats it to display nicely in a HTML Web page.

Details

JSON_Formatter

Allows you to pretty-print JSON data in a human-readable format

Latest Stable Version License Latest Stable Version Minimum PHP Version

Installation

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:

alt tag


  Classes of chrys ugwu  >  PHP JSON Pretty Print  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  

 

Name: PHP JSON Pretty Print
Base name: json_formatter
Description: Display data types like human-readable JSON values
Version: -
PHP version: 5
License: BSD License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image HTML HTML generation and processing View top rated classes
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Data types Modeling and manipulating data types View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
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  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Plain text file composer.json Data Auxiliary data
Plain text file index.php Example Example
Plain text file README.md Doc. Documentation
Image file SS.png Data Auxiliary data
Plain text file text.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
  Plain text file Json.php Class Class source

Download 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.