定制 mateodioev/jsondecoder 二次开发

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

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

mateodioev/jsondecoder

最新稳定版本:v1.2.1

Composer 安装命令:

composer require mateodioev/jsondecoder

包简介

Json decoder, encoder

README 文档

README

Decode a json string into a class

First step

composer require mateodioev/jsondecoder
use Mateodioev\Json;

Usage

Create a class with public atributes, egg:

class User {
	public int $id;
	public string $name;
	public string $username;
}

Create a new instance of JSON class with json raw

$jsonRaw = '{"id": 1, "name": "Mateo", "username": "mateodioev"}';
$json = new JSON($jsonRaw);

Decode content

$u = new User;

$json->decode($u)

Now var $u containts content of $jsonRaw

var_dump($u);

example output:

class User#2 (3) {
  public int $id =>
  int(1)
  public string $name =>
  string(5) "Mateo"
  public string $username =>
  string(10) "mateodioev"
}

Exceptions

Mateodioev\Json\JsonDecodeException

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固