PHPackages                             phphleb/nicejson - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phphleb/nicejson

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phphleb/nicejson
================

Convert json to readable form

1.0.0(2y ago)16.0k↓40.9%5MITPHPPHP &gt;=8.2.0

Since Feb 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/phphleb/nicejson)[ Packagist](https://packagist.org/packages/phphleb/nicejson)[ RSS](/packages/phphleb-nicejson/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (5)

NICEJSON
========

[](#nicejson)

[![HLEB1](https://camo.githubusercontent.com/26972ff55bd84c3e74768eb0b2eaa3196a7561cd1a804ef9b4d34dfa692aeb50/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f484c45422d312d6f6c697665)](https://github.com/phphleb/hleb) [![HLEB2](https://camo.githubusercontent.com/838b21da13ac6fa4384590a6a151d564a2832887c0a085cd911223d700ca379c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f484c45422d322d6461726b6379616e)](https://github.com/phphleb/hleb) [![PHP](https://camo.githubusercontent.com/b5d4f7901c58ad1ddfff679966f426cc25a9354bab763846b9a7276c2feab4e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d626c7565)](https://camo.githubusercontent.com/b5d4f7901c58ad1ddfff679966f426cc25a9354bab763846b9a7276c2feab4e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e322d626c7565) [![License: MIT](https://camo.githubusercontent.com/fdf4c838e998efe42a2cfb3c27b8addedc9f7ddd1ecfecc4b19254f784232b7a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542532302846726565292d627269676874677265656e2e737667)](https://github.com/phphleb/hleb/blob/master/LICENSE)

Previous code for PHP version &lt; 8.2

### Convert json to readable form

[](#convert-json-to-readable-form)

Install using Composer:

```
composer require phphleb/nicejson
```

---

Convert

```
{"example":["first","second"]}
```

to

```
{
   "example": [
       "first",
       "second"
   ]
}
```

```
$data = '{"example":["first","second"]}'; // string json
file_put_contents('/path/to/result/json/file/', (new \Phphleb\Nicejson\JsonConverter())->get($data));
```

or

```
$data = ["example"=>["first","second"]]; // array
file_put_contents('/path/to/result/json/file/', (new \Phphleb\Nicejson\JsonConverter())->get($data));
```

or

```
$data = (object) ["example"=>["first","second"]]; // object
file_put_contents('/path/to/result/json/file/', (new \Phphleb\Nicejson\JsonConverter())->get($data));
```

add flag to json\_encode(...)

```
use Phphleb\Nicejson\JsonConverter;
$jsonConverterObject = new JsonConverter(JSON_FORCE_OBJECT);
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

832d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/add493abc37e54c44eabe920dd9facf7aae69955c84bb8245b561f3fc51708da?d=identicon)[phphleb](/maintainers/phphleb)

---

Top Contributors

[![phphleb](https://avatars.githubusercontent.com/u/48386098?v=4)](https://github.com/phphleb "phphleb (10 commits)")

### Embed Badge

![Health badge](/badges/phphleb-nicejson/health.svg)

```
[![Health](https://phpackages.com/badges/phphleb-nicejson/health.svg)](https://phpackages.com/packages/phphleb-nicejson)
```

###  Alternatives

[phpcollection/phpcollection

General-Purpose Collection Library for PHP

1.0k64.0M34](/packages/phpcollection-phpcollection)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
