Skip to content

json_encode/json_decode wrapper

License

Notifications You must be signed in to change notification settings

thetribeio/json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thetribe/json

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);