thetribe/json
is a small wrapper around the json_*
fonctions that does two things:
- Convert errors to exceptions
- Normalize parameters
Install thetribe/json
using Composer.
composer require thetribe/json
<?php
use function TheTribe\JSON\decode;
$value = decode($json, $options, $depth);
<?php
use function TheTribe\JSON\encode;
$json = encode($value, $options, $depth);