定制 ccinn/commentjson-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ccinn/commentjson-php

Composer 安装命令:

composer require ccinn/commentjson-php

包简介

Similar to python commentjson,More powerful,use PHP implementation

README 文档

README

Similar to python commentjson,More powerful,use PHP implementation

Installation

composer require ccinn/commentjson-php

Basic Usage

$json = <<<JSON
{\\n
     "name": "Vaidik Kapoor", # Person's name\\n
     "location": "Delhi, India", // Person's location\\n
\\n
     # Section contains info about\\n
     // person's appearance\\n
     "appearance": {\\n
         "hair_color": "black",\\n
         "eyes_color": "black",\\n
         "height": "6"\\n
     }\\n
 }\\n
JSON;

$result = \CommentJson\CommentJson::loads($json);

var_dump(json_decode($result, true));

/**
array(3) {
    ["name"]=>
        string(13) "Vaidik Kapoor"
    ["location"]=>
        string(12) "Delhi, India"
    ["appearance"]=>
    array(3) {
        ["hair_color"]=>
            string(5) "black"
        ["eyes_color"]=>
            string(5) "black"
        ["height"]=>
            string(1) "6"
    }
}
 */
 
 
 $json2 = <<<JSON
 {"a":1,
 "b":2,// comment
 "c":3 /* inline comment */,
 // comment
 "d":/* also a comment */"d",
 /* creepy comment*/"e":2.3,
 /* multi line
 comment */
 "f":"f1"}
 JSON;
 
 $result = \CommentJson\CommentJson::loads($json2);
 
 var_dump(json_decode($result, true));
 
 /**
 array(6) {
 ["a"]=>
 int(1)
 ["b"]=>
 int(2)
 ["c"]=>
 int(3)
 ["d"]=>
 string(1) "d"
 ["e"]=>
 float(2.3)
 ["f"]=>
 string(2) "f1"
 }
  */

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-12-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固