PHPackages                             danharper/jsonx - 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. danharper/jsonx

ActiveLibrary

danharper/jsonx
===============

JSONx is an IBM standard for representing JSON as XML

v0.1.0(10y ago)2157.3k↓50%22MITPHP

Since Nov 22Pushed 7y ago2 watchersCompare

[ Source](https://github.com/danharper/JSONx)[ Packagist](https://packagist.org/packages/danharper/jsonx)[ RSS](/packages/danharper-jsonx/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (2)

JSONx
=====

[](#jsonx)

[![](https://camo.githubusercontent.com/ff78ff19a0053058d59b15a747bd86a307115b68860a6be50f22443c524cc7c5/68747470733a2f2f6170692e7472617669732d63692e6f72672f64616e6861727065722f4a534f4e782e737667)](https://travis-ci.org/danharper/JSONx) [![Latest Stable Version](https://camo.githubusercontent.com/5db1fb31c24a52290d6071c280032509c9ad91bd9956a9022263f84bceb8590c/68747470733a2f2f706f7365722e707567782e6f72672f64616e6861727065722f6a736f6e782f762f737461626c65)](https://packagist.org/packages/danharper/jsonx) [![License](https://camo.githubusercontent.com/a35d7f71b193e527b374c4b280eff427a90fd1089643025f02600a09e174062d/68747470733a2f2f706f7365722e707567782e6f72672f64616e6861727065722f6a736f6e782f6c6963656e7365)](https://packagist.org/packages/danharper/jsonx)

A library implementing IBM's standard format for [representing JSON as XML](http://www-01.ibm.com/support/knowledgecenter/SS9H2Y_6.0.0/com.ibm.dp.xm.doc/json_jsonx.html). Provides support for both reading &amp; writing of JSONx. [The spec draft for JSONx can be found here](http://tools.ietf.org/html/draft-rsalz-jsonx-00).

**WHY?!** That was my initial reaction, too. However it's very useful when you're trying to integrate one system which speaks JSON with another which speaks XML, without having to make potentially large changes.

Installation
------------

[](#installation)

```
composer require danharper/jsonx

```

Usage
-----

[](#usage)

```
$jsonx = new danharper\JSONx\JSONx;

$jsonx->toJSONx([
  'foo' => [ 'bar', true, 2, 3.14, null, [], (object) [] ]
]);

/*

    bar
    true
    2
    3.14

*/

$jsonx->fromJSONx('

    bar
    true
    2
    3.14

');

/*
object(stdClass)#180 (1) {
  ["foo"]=> array(7) {
    [0]=> string(3) "bar"
    [1]=> bool(true)
    [2]=> int(2)
    [3]=> float(3.14)
    [4]=> NULL
    [5]=> array(0) {
    }
    [6]=> object(stdClass)#173 (0) {
    }
  }
}
*/
```

Integrations
------------

[](#integrations)

Want to add full XML support to your JSON-speaking Laravel API with just one middleware? Check out [`danharper/laravel-jsonx`](https://github.com/danharper/LaravelJSONx).

Want automatic conversion of your PSR-7 compatible messages? Check out [`danharper/psr7-jsonx`](https://github.com/danharper/Psr7JSONx).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

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

3830d ago

### Community

Maintainers

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

---

Top Contributors

[![danharper](https://avatars.githubusercontent.com/u/510740?v=4)](https://github.com/danharper "danharper (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danharper-jsonx/health.svg)

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

PHPackages © 2026

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