phpninjas/json 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

phpninjas/json

最新稳定版本:v0.1.0

Composer 安装命令:

composer require phpninjas/json

包简介

关键字:

README 文档

README

Get Composer

curl -sS https://getcomposer.org/installer | php
php composer.phar install

composer.json

{
  "require": {
    "phpninjas/json": "v0.1.0"
  }
}

JSON Library

A simple wrapper around the json_encode and json_decode functions that handle errors with exceptions as opposed to using the built-in functions from PHP.

Encoding

Turn a php variable into a json string (and throw an error during failure).

<?php

use phpninjas\JSON\JSON;
use phpninjas\JSON\JsonEncodingException;

try {
    $jsonString = JSON::encode($var);
}catch(JsonEncodingException $e){
    // handle exception
}

Decoding

Turn a JSON string into a php variable (and throw an error during failure).

<?php

use phpninjas\JSON\JSON;
use phpninjas\JSON\JsonDecodingException;

try {
    $var = JSON::decode($jsonString);
}catch(JsonDecodingException $e){
    // handle exception
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-10-15