定制 amostajo/php-json-array 二次开发

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

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

amostajo/php-json-array

Composer 安装命令:

composer require amostajo/php-json-array

包简介

Simple class that extends the capabilities of the basic php *array* by adding json casting and file handling (read and write).

README 文档

README

Latest Stable Version Total Downloads License

Simple class that extends the capabilities of the basic php array by adding json casting and file handling (read and write).

Quick start

  • Clone or download the latest release.
  • Via composer:
composer require amostajo/php-json-array

Usage

Creating an array:

$array = new JSONArray();

Add items as you normally would do using arrays:

$array[] = 'example';

$array['ID'] = 123;
$array['person'] = ['name' => 'John', 'lastname' => 'Doe'];

Casting:

// To JSON
echo $array->toJson();

// To string (casts to JSON at the end)
echo (string)$array;

Write to file:

// Writes array as json string into filename.
$array->write($filename);

Read from file:

// Reads from filename.
$array->read($filename);

// Use loaded array
echo $array[$key];

Coding Guidelines

The coding is PSR-2.

License

JSONArray is free software distributed under the terms of the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固