arokettu / json
ext-json wrapper with sane defaults
1.1.0
2020-08-29 02:22 UTC
Requires
- php: ^7.3 || ^8.0
- ext-json: *
This package is auto-updated.
Last update: 2020-12-28 23:55:29 UTC
README
A wrapper for the standard ext-json with sane defaults
Decoding wrapper is the main purpose of the library. It's killer feature is that JSON objects become instances of ArrayObject instead of stdClass. This both keeps array/object types of the original and allows to work with all data as with arrays.
<?php
$obj = \Arokettu\Json\Json::decode('{"abc": 123}');
// we can access any data array-style
unset($obj['abc']);
// object will not turn into array
echo \Arokettu\Json\Json::encode($obj);
Installation
composer require 'arokettu/json'
Documentation
Read full documentation here: https://sandfox.dev/php/json.html
Support
Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/php-json/-/issues
License
The library is available as open source under the terms of the MIT License.