PHPackages                             dmitrirussu/rjson-php - 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. dmitrirussu/rjson-php

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

dmitrirussu/rjson-php
=====================

Compress array collection data to json

1.0.2.x-dev(11y ago)143.8k4GNUPHPPHP &gt;=5.3.2

Since Aug 15Pushed 8y ago4 watchersCompare

[ Source](https://github.com/dmitrirussu/RJSON-php)[ Packagist](https://packagist.org/packages/dmitrirussu/rjson-php)[ RSS](/packages/dmitrirussu-rjson-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

[ ![](https://camo.githubusercontent.com/3a30bb4559a4113984f9da3c3c0dd814b7147603484f6025a02682e7599b5faa/68747470733a2f2f7472617669732d63692e6f72672f646d6974726972757373752f524a534f4e2d7068702e706e67 "Build Status Images")](https://travis-ci.org/dmitrirussu/RJSON-php)[![GitHub version](https://camo.githubusercontent.com/b35d1e7e1db94092b1fc7dcba9cdc7672170e8281e4328c1c5b612ac740254ae/68747470733a2f2f62616467652e667572792e696f2f67682f646d697472697275737375253246524a534f4e2d7068702e737667)](http://badge.fury.io/gh/dmitrirussu%2FRJSON-php)PHP5 RJson Version 1.0.2
========================

[](#php5-rjson-version-102)

Copyright (c) 2013, Dmitri Russu RJson return compact recursive data Array or Object Array by Algorithm Dmytro Dogadailo .

=== Compress Array data and Json data until 60%!
================================================

[](#compress-array-data-and-json-data-until-60)

RJSON-php VS RJSON-js
=====================

[](#rjson-php-vs-rjson-js)

How begin to use PHP RJSON example:

```
    $data = //Your recursive Array data;
    $pack = RJson::pack($data);
    $unpack = RJson::unpack($pack);
```

How begin to use JavaScript RJSON example:

```
    data = //jason packedge from php;
    unpack = RJSON.unpack(data);
    packAndSendToSerevr = RJSON.pack(unpack);
```

...

```
---------------------------------------------------------------------------------------
JavaScrip RJSON release https://github.com/dogada/RJSON from Dmytro Dogadailo.
---------------------------------------------------------------------------------------

```

RJson converts any Array data collection into more compact recursive form. Compressed data is still JSON and can be parsed with `JSON.parse`. RJson can compress not only homogeneous collections, but any data sets with free structure.

Below you can see initial form!

```
    Array:
	$data['data_process'] = array(
	'template' => array('layers' => array(
	'layer_id_one' => array('age' => 23,'name' => 'Robert',  'height' => 187),
	'layer_id_two' => array('name' => 'Andre', 'age' => 24, 'height' => 188),
	),
	'themes_one' => array(
	'theme_id_one' => array('name' => 'Green', 'width' => 11),
	'theme_id_two' => array('name' => 'Yellow', 'width' => 12),
	),
	'themes_two' => array(
	'theme_id_one' => array('name' => 'Green', 'width' => 11),
	'theme_id_two' => array('name' => 'Yellow', 'width' => 12),
	),
	'designs' => array(
	array('title' => 'Design_1', 'width' => 23, 'height' => 187),
	array('width' => 24, 'title' => 'Design_2','height' => 181),
	)
	),
	'id' => 7,
	'tags' => array('php', 'javascript', 2013, null, false, true),
	'users' => array(
	array('first' => 'Homer', 'last' => 'Simpson'),
	array('first' => 'Hank', 'last' => 'Hill'),
	),
	'library' => array(
	array('title' => 'RJSON-php', 'author' => 'Dmitri Russu', 'year' => 2013),
	array('title' => 'JavaScrip RJSON', 'author' => 'Dmytro Dogadailo', 'year' => 2012))
	);
```

RJson result compact json or one compact php array():

```
RJson ENCODED Packedge

```

```
	{"id":7,
		"library":
			[{"author":"Dmitri Russu","title":"RJSON-php","year":2013},
			[3,"Dmytro Dogadailo","JavaScrip RJSON",2012]],
		"tags":
			["php","javascript",2013,null,false,true],
		"template":{
			"designs":
				[{"height":187,"title":"Design_1","width":23},
				[5,181,"Design_2",24]],
			"layers":{
				"layer_id_one":{"age":23,"height":187,"name":"Robert"},
				"layer_id_two":[7,24,188,"Andre"]},
			"themes_one":
				{"theme_id_one":{"name":"Green","width":11},
				"theme_id_two":[9,"Yellow",12]},
			"themes_two":
				[8,[9,"Green",11],
				[9,"Yellow",12]]},
			"users":
				[{"first":"Homer","last":"Simpson"},
				[10,"Hank","Hill"]]}
```

EXAMPLE OF USE RJson:

You make a call class with one simple single tone request

```
    $data = array(
    'projects' => Db_Model_Projects::findAllProjects($returnArrayRows),
    'settings' => Db_Model_Settings::findAllSettings($returnArrayRows),
    'pages' => Db_Model_Pages::findAllPages($returnArrayRows)
    );

    $compactArrayPackedge = RJson::pack($data);

    $compactJsonFormatPackedge = RJson::pack($data, $json = true);
```

```
    $compactJsonFormatPackedge - this packedge you can send to Ajax request Where can make unpack with Js library
    *
    *
    $.ajax( {
    "dataType": 'json',
    "type": "POST",
    "url": 'index.php?action=getData',
    "success": function(data) {
    packedge = RJSON.unpack(data);
    console.dir(packedge);
    }
    });

    //Send packedge to server
    packedge = RJSON.pack(data);

    $.ajax( {
    "dataType": 'json',
    "type": "POST",
    "data": data,
    "url": 'index.php?action=saveData',
    "success": function(result) {
    console.log(result);
    }
    });

RJson is a good practice to use on your Applications which make requests at server for obtains a big data
to client Application.
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

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

4295d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d39ff7f36a02fa7a130cdae54924a98b1a6e05d7741eb3f824192900c5dfef4?d=identicon)[dmitrirussu](/maintainers/dmitrirussu)

---

Top Contributors

[![dmitrirussu](https://avatars.githubusercontent.com/u/4028904?v=4)](https://github.com/dmitrirussu "dmitrirussu (25 commits)")[![bl4ckbon3](https://avatars.githubusercontent.com/u/4352039?v=4)](https://github.com/bl4ckbon3 "bl4ckbon3 (1 commits)")

---

Tags

jsonarrayarchivecompresscollection

### Embed Badge

![Health badge](/badges/dmitrirussu-rjson-php/health.svg)

```
[![Health](https://phpackages.com/badges/dmitrirussu-rjson-php/health.svg)](https://phpackages.com/packages/dmitrirussu-rjson-php)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k9.2M108](/packages/cuyz-valinor)[aimeos/map

Easy and elegant handling of PHP arrays as array-like collection objects similar to jQuery and Laravel Collections

4.2k412.9k11](/packages/aimeos-map)[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4561.2M5](/packages/athari-yalinqo)[cerbero/lazy-json

Framework-agnostic package to load JSONs of any dimension and from any source into Laravel lazy collections.

254309.8k1](/packages/cerbero-lazy-json)[jbzoo/data

An extended version of the ArrayObject object for working with system settings or just for working with data arrays

891.6M23](/packages/jbzoo-data)

PHPackages © 2026

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