2017 © Pedro Peláez
 

library json-comment

Lightweight JSON comment stripper library for PHP

image

adhocore/json-comment

Lightweight JSON comment stripper library for PHP

  • Sunday, July 22, 2018
  • by adhocore
  • Repository
  • 1 Watchers
  • 7 Stars
  • 129 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 1333 % Grown

The README.md

adhocore/json-comment

Latest Version Travis Build Scrutinizer CI Codecov branch StyleCI Software License, (*1)

  • Lightweight JSON comment stripper library for PHP.
  • Makes possible to have comment in any form of JSON data.
  • Supported comments: single line // comment or multi line /* comment */.

Installation

composer require adhocore/json-comment

Usage

use Ahc\Json\Comment;

// The JSON string!
$someJsonText = '{"a":1,
"b":2,// comment
"c":3 /* inline comment */,
// comment
"d":/* also a comment */"d",
/* creepy comment*/"e":2.3,
/* multi line
comment */
"f":"f1"}';

// OR
$someJsonText = file_get_contents('...');

// Strip only!
(new Comment)->strip($someJsonText);

// Strip and decode!
(new Comment)->decode($someJsonText);

// You can pass args like in `json_decode`
(new Comment)->decode($someJsonText, $assoc = true, $depth = 512, $options = JSON_BIGINT_AS_STRING);

// Or you can use static alias of decode:
Comment::parse($json, true);

The Versions

22/07 2018

dev-master

9999999-dev

Lightweight JSON comment stripper library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Jitendra Adhikari

json comment strip-comment

19/07 2018

v0.0.6

0.0.6.0

Lightweight JSON comment stripper library for PHP

  Sources   Download

MIT

The Development Requires

by Jitendra Adhikari

json comment strip-comment

17/07 2018

v0.0.5

0.0.5.0

Lightweight JSON comment stripper library for PHP

  Sources   Download

MIT

The Development Requires

by Jitendra Adhikari

json comment strip-comment

21/06 2018

v0.0.4

0.0.4.0

Lightweight JSON comment stripper library for PHP

  Sources   Download

MIT

The Development Requires

by Jitendra Adhikari

json comment strip-comment

24/10 2017

dev-develop

dev-develop

Lightweight JSON comment stripper library for PHP

  Sources   Download

MIT

The Development Requires

by Jitendra Adhikari

json comment strip-comment

14/08 2017

v0.0.3

0.0.3.0

Lightweight JSON comment stripper library for PHP

  Sources   Download

MIT

The Development Requires

by Jitendra Adhikari

json comment strip-comment

12/08 2017

v0.0.2

0.0.2.0

Lightweight JSON comment stripper library for PHP

  Sources   Download

MIT

The Development Requires

by Jitendra Adhikari

json comment strip-comment