thetribe/json

json_encode/json_decode 包装器

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

This package is not auto-updated.

Last update: 2024-09-29 04:14:29 UTC


README

thetribe/json 是一个围绕 json_* 函数的小型包装器,它做了两件事:

  • 将错误转换为异常
  • 标准化参数

安装

使用 Composer 安装 thetribe/json

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