PHPackages                             victorap93/readjson - 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. victorap93/readjson

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

victorap93/readjson
===================

Read Json makes it easy to read and work with json files.

2.0.0(4y ago)364MITPHPPHP &gt;=5.3.2

Since Aug 8Pushed 4y ago1 watchersCompare

[ Source](https://github.com/victorap93/readjson)[ Packagist](https://packagist.org/packages/victorap93/readjson)[ RSS](/packages/victorap93-readjson/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)DependenciesVersions (8)Used By (0)

Read Json
=========

[](#read-json)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/fddcf696897ceab210aacc080b95b0ef0a459fca319b2f99f144260b2a589354/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f766963746f72617039332f726561646a736f6e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/victorap93/readjson/releases)[![Total Downloads](https://camo.githubusercontent.com/5695ce019652f07b089a87863bd5a8ec79ef265bed60c60bb83a5127b1d9ed3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766963746f72617039332f726561646a736f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victorap93/readjson)

Read Json makes it easy to read and work with json files.

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

[](#installation)

The recommended way to install this is through [Composer](https://getcomposer.org/).

```
composer require victorap93/readjson
```

How to use
----------

[](#how-to-use)

Assuming you have a *.json* file `./readjson/stores.json` with the following content.

```
{
    "stores": [
        {
            "name": "store one",
            "products": [
                {
                    "name": "product one",
                    "amount": 10
                },
                {
                    "name": "product two",
                    "amount": 20
                }
            ]
        },
        {
            "name": "store two",
            "products": [
                {
                    "name": "product two",
                    "amount": 22
                },
                {
                    "name": "product three",
                    "amount": 33
                }
            ]
        }
    ]
}
```

And this *.php* in the same folder `./readjson/index.php`, the example below show different ways to acess *.json* file.

```
use \victorap93\ReadJson;

$json_path = "./stores.json";

// Get all json content.
$ReadJson = new ReadJson($json_path);
$json_object_value1 = $ReadJson->getJsonObject();

// Accessing the obtained object.
$json_object_value2 = $json_object_value1->stores[0]->products;

// Get a specified json content position in instance of class.
$ReadJson = new ReadJson($json_path, ['stores', 0, 'products']);
$json_object_value3 = $ReadJson->getJsonObject();

// Get a specified json content position in method call.
$ReadJson = new ReadJson($json_path, ['stores', 0]);
$json_object_value4 = $ReadJson->getJsonObject(['products']);

// Get a specified json content position with object.
$json_object_value5 = $ReadJson->accessRecursiveKeys($json_object_value4, [0, 'name']);
```

Help and docs
-------------

[](#help-and-docs)

- [JSON](https://www.json.org/json-en.html)

License
-------

[](#license)

Read Json is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Every ~339 days

Recently: every ~424 days

Total

6

Last Release

1504d ago

Major Versions

1.0.4 → 2.0.02022-04-02

PHP version history (3 changes)1.0.1PHP ^5.3.3

1.0.2PHP ^5.3.2

1.0.3PHP &gt;=5.3.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/21a59b5dc4d17fe6457c4a31e88c02103e0cb443c0400827baa094045b164ce9?d=identicon)[victorap93](/maintainers/victorap93)

---

Top Contributors

[![victorap93](https://avatars.githubusercontent.com/u/4273876?v=4)](https://github.com/victorap93 "victorap93 (14 commits)")

---

Tags

json

### Embed Badge

![Health badge](/badges/victorap93-readjson/health.svg)

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

###  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)[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)[clue/ndjson-react

Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.

15267.7M16](/packages/clue-ndjson-react)

PHPackages © 2026

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