thetribe/json

json_encode/json_decode wrapper

v0.1.1 2017-06-07 12:25 UTC

This package is not auto-updated.

Last update: 2024-04-28 02:00:42 UTC


README

thetribe/json is a small wrapper around the json_* fonctions that does two things:

  • Convert errors to exceptions
  • Normalize parameters

Install

Install thetribe/json using Composer.

composer require thetribe/json

Usage

Decoding

<?php

use function TheTribe\JSON\decode;

$value = decode($json, $options, $depth);

Encoding

<?php

use function TheTribe\JSON\encode;

$json = encode($value, $options, $depth);