| Package Data | |
|---|---|
| Maintainer Username: | seffeng | 
| Maintainer Contact: | save.zxf@gmail.com (seffeng) | 
| Package Create Date: | 2022-08-25 | 
| Package Last Update: | 2023-08-03 | 
| Language: | PHP | 
| License: | MIT | 
| Last Refreshed: | 2025-10-26 03:11:49 | 
| Package Statistics | |
|---|---|
| Total Downloads: | 1,512 | 
| Monthly Downloads: | 31 | 
| Daily Downloads: | 0 | 
| Total Stars: | 0 | 
| Total Watchers: | 1 | 
| Total Forks: | 0 | 
| Total Open Issues: | 0 | 
# 安装
$ composer require seffeng/json-helper
|---src
|   |   Json.php
|   |---Traits
|           JsonTrait.php
|---tests
|       JsonTest.php
/**
 * TestController.php
 * 示例
 */
namespace App\Http\Controllers;
use Seffeng\JsonHelper\Json;
class TestController extends Controller
{
    public function index()
    {
        $arr = [
            'a' => [
                'b' => [
                    'c' => 'ccc'
                ]
            ],
            'd' => [
                'b' => 'ccc',
                'e' => [
                    'f' => 'hhh'
                ]
            ]
        ];
        $json = Json::encode($arr);
        var_dump($json);
        print_r(Json::decode($json));
    }
}
1、更多示例请参考 tests 目录下测试文件。