PHPackages                             atheon/json-builder - 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. atheon/json-builder

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

atheon/json-builder
===================

JSON builder with escaping control for PHP 5.6+

1.0.0(3y ago)0231MITPHPPHP ^5.6|^7.0|^8.0

Since Oct 25Pushed 3y agoCompare

[ Source](https://github.com/Atheon/ivory-json-builder)[ Packagist](https://packagist.org/packages/atheon/json-builder)[ RSS](/packages/atheon-json-builder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (1)

README
======

[](#readme)

[![Travis Build Status](https://camo.githubusercontent.com/0315ad2b7b34a9dbd41970deda0aa67bad92f42e17d258ce71314f56578a0039/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6567656c6f656e2f69766f72792d6a736f6e2d6275696c6465722e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/egeloen/ivory-json-builder)[![AppVeyor Build status](https://camo.githubusercontent.com/4ba81e6931068ab36b14f8f1747ac7d4ff429273a2562ad833b25ca4c4e23da1/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f3966367332796137637861616d6d32302f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/egeloen/ivory-json-builder/branch/master)[![Code Coverage](https://camo.githubusercontent.com/db6f27749a0d6b2c536c1b504473d387c9516d314761de610b6ef4b4bb95d090/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6567656c6f656e2f69766f72792d6a736f6e2d6275696c6465722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/egeloen/ivory-json-builder/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5c3b064f2028dd32998ac7e9ea40960b5bfccbee1d89944feea8bd07960cce80/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6567656c6f656e2f69766f72792d6a736f6e2d6275696c6465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/egeloen/ivory-json-builder/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/c3ac97195ae0eddda420832b9371b809c02f9e093a8bd5a90a0c075c59bdb267/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6567656c6f656e3a6a736f6e2d6275696c6465722f62616467652e737667)](https://www.versioneye.com/php/egeloen:json-builder)

[![Latest Stable Version](https://camo.githubusercontent.com/f18c5906fc1e9557549fdf9fd203bfd5bdcf3e9512c14eefb29310ae38454246/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f6a736f6e2d6275696c6465722f762f737461626c652e737667)](https://packagist.org/packages/egeloen/json-builder)[![Latest Unstable Version](https://camo.githubusercontent.com/142bb3535803b6fc5323e7a32d190880046f6a2845eabeeb7de4053f59e09033/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f6a736f6e2d6275696c6465722f762f756e737461626c652e737667)](https://packagist.org/packages/egeloen/json-builder)[![Total Downloads](https://camo.githubusercontent.com/8079cff404622ef1191830101e19aa73599e5ecb4991e1a869ee5244a1d97ef1/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f6a736f6e2d6275696c6465722f646f776e6c6f6164732e737667)](https://packagist.org/packages/egeloen/json-builder)[![License](https://camo.githubusercontent.com/ea8b456f8ec7a63e24feb78e6a4c5edc2d2acc5043f429176607c6cbf7a8b54f/68747470733a2f2f706f7365722e707567782e6f72672f6567656c6f656e2f6a736f6e2d6275696c6465722f6c6963656e73652e737667)](https://packagist.org/packages/egeloen/json-builder)

The Ivory JSON builder is a PHP 5.6+ library allowing you to build your JSON through the Symfony2 [PropertyAccess](http://symfony.com/doc/current/components/property_access/index.html) component while keeping the control of the value escaping.

```
use Ivory\JsonBuilder\JsonBuilder;

$builder = new JsonBuilder();
$json = $builder
    ->setValues(array('foo' => array('bar')))
    ->setValue('[baz]', 'bat', false)
    ->build();

// {"foo":["bar"],"baz":bat}
echo $json;
```

Documentation
-------------

[](#documentation)

1. [Installation](/doc/installation.md)
2. [Usage](/doc/usage.md)

Testing
-------

[](#testing)

The library is fully unit tested by [PHPUnit](http://www.phpunit.de/) with a code coverage close to **100%**. To execute the test suite, check the travis [configuration](/.travis.yml).

Contribution
------------

[](#contribution)

We love contributors! Ivory is an open source project. If you'd like to contribute, feel free to propose a PR! You can follow the [CONTRIBUTING](/CONTRIBUTING.md) file which will explain you how to set up the project.

License
-------

[](#license)

The Ivory JSON Builder is under the MIT license. For the full copyright and license information, please read the [LICENSE](/LICENSE) file that was distributed with this source code.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% 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

1298d ago

### Community

Maintainers

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

---

Top Contributors

[![GeLoLabs](https://avatars.githubusercontent.com/u/149005863?v=4)](https://github.com/GeLoLabs "GeLoLabs (68 commits)")[![Atheon](https://avatars.githubusercontent.com/u/767987?v=4)](https://github.com/Atheon "Atheon (1 commits)")[![sdaoudi](https://avatars.githubusercontent.com/u/4227015?v=4)](https://github.com/sdaoudi "sdaoudi (1 commits)")

---

Tags

jsonbuilderEscape

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/atheon-json-builder/health.svg)

```
[![Health](https://phpackages.com/badges/atheon-json-builder/health.svg)](https://phpackages.com/packages/atheon-json-builder)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k316.9M612](/packages/justinrainbow-json-schema)[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[egeloen/json-builder

JSON builder with escaping control for PHP 5.6+

965.7M9](/packages/egeloen-json-builder)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[colinodell/json5

UTF-8 compatible JSON5 parser for PHP

30422.2M45](/packages/colinodell-json5)

PHPackages © 2026

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