walnut / lib_jsonserializer
There is no license information available for the latest version (0.0.1) of this package.
0.0.1
2021-09-11 16:11 UTC
Requires (Dev)
- phpunit/phpunit: ^9.5.9
- vimeo/psalm: ^4.9.3
This package is not auto-updated.
Last update: 2024-10-24 13:30:23 UTC
README
This is library a very tiny wrapper that provides a simple object-oriented interface to JSON serialization.
Examples
The usage is straightforward (same as json_encode/json_decode)
$serializer = new PhpJsonSerializer; echo $serializer->encode(['a' => 1]); //outputs {"a": 1} echo $serializer->decode('{"a": 1}', true)['a']; //outputs 1 echo $serializer->decode('{"a": 1}', false)->a; //outputs 1