PHPackages                             8ctopus/relaxed-json - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. 8ctopus/relaxed-json

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

8ctopus/relaxed-json
====================

Tired of JSON's super strict syntax? Then relaxed JSON if for you.

1.0.4(5mo ago)0143MITPHPPHP &gt;=7.3CI passing

Since Aug 31Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/8ctopus/relaxed-json)[ Packagist](https://packagist.org/packages/8ctopus/relaxed-json)[ Docs](https://github.com/8ctopus/relaxed-json)[ RSS](/packages/8ctopus-relaxed-json/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

relaxed json
============

[](#relaxed-json)

[![packagist](https://camo.githubusercontent.com/33b7ae558342dcb3ef559255b64263fc14bfd05e4a5b1dd3a7e6e824ff925165/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f72656c617865642d6a736f6e2f76)](https://packagist.org/packages/8ctopus/relaxed-json)[![downloads](https://camo.githubusercontent.com/b5fe44b7a0b54eeb25521ac6262a91255bbf3a50a396f41bef19ba475e492066/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f72656c617865642d6a736f6e2f646f776e6c6f616473)](https://packagist.org/packages/8ctopus/relaxed-json)[![min php version](https://camo.githubusercontent.com/421d7ee6409585e53ad5602248126f561e928f0afd5eb4dd1f587ed749c95fac/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f72656c617865642d6a736f6e2f726571756972652f706870)](https://packagist.org/packages/8ctopus/relaxed-json)[![license](https://camo.githubusercontent.com/9dfbb8773e8d2f86ade18eb25a1d84b0c419300e76886998ff3169ddf06743de/68747470733a2f2f706f7365722e707567782e6f72672f3863746f7075732f72656c617865642d6a736f6e2f6c6963656e7365)](https://packagist.org/packages/8ctopus/relaxed-json)[![tests](https://github.com/8ctopus/relaxed-json/actions/workflows/tests.yml/badge.svg)](https://github.com/8ctopus/relaxed-json/actions/workflows/tests.yml)[![code coverage badge](https://raw.githubusercontent.com/8ctopus/relaxed-json/image-data/coverage.svg)](https://raw.githubusercontent.com/8ctopus/relaxed-json/image-data/coverage.svg)[![lines of code](https://raw.githubusercontent.com/8ctopus/relaxed-json/image-data/lines.svg)](https://raw.githubusercontent.com/8ctopus/relaxed-json/image-data/lines.svg)

Tired of JSON's super strict syntax? Then relaxed JSON if for you.

features
--------

[](#features)

- supports comments in all forms `// my comment`, `/* my comment */`
- ignores trailing commas at the end of an array or object
- throws an Exception when the json is invalid
- zero dependencies

install
-------

[](#install)

```
composer require 8ctopus/relaxed-json

```

usage
-----

[](#usage)

```
use Oct8pus\RelaxedJson;

$json =
