PHP code example of workbunny / pjson

1. Go to this page and download the library: Download workbunny/pjson library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

workbunny / pjson example snippets


// 原生解析
$php_json = json_decode($json_str, true);
// 拿其中一个字段
$type = $php_json['type'];
var_dump($type);

// pjson解析
$json = Json::parse($json_str);
$type = Json::get($json, 'type');
var_dump(Json::val($type));