JsonUtil.php
444 字节
<?php
namespace Lackoxygen\TopWarehouse\Utils;
use Lackoxygen\TopWarehouse\Exception\Exception;
class JsonUtil
{
public static function encode($array, int $flags = JSON_UNESCAPED_UNICODE, int $depth = 512)
{
return json_encode($array, $flags, $depth);
}
public static function decode(string $json, ?bool $associative = true, int $depth = 512)
{
return json_decode($json, $associative, $depth);
}
}