定制 seworqs/json-editor 二次开发

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

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

seworqs/json-editor

最新稳定版本:1.3.0

Composer 安装命令:

composer require seworqs/json-editor

包简介

A dot-notated, chainable JSON editor for PHP with built-in file support and robust array handling.

README 文档

README

A dot-notated, chainable JSON editor for PHP with built-in file support and robust array handling.

Installation

Install via Composer.

$> composer require seworqs/json-editor

Usage

use Seworqs\Json\JsonEditor;

// Create a new file.
$newJson1 = JsonEditor::createNew("/path/to/save/json/file.json");

// If you want to overwrite a file when it already exists.
$newJson2 = JsonEditor::createNew("/path/to/save/json/file.json", true);

// Create a new file.
$newJson3 = JsonEditor::createFromFile("/path/to/existing/json/file.json");

// Overwrite boolean.
$overwrite = false;

// Add key/value
$newJson3->add('some-key', 'some-value', $overwrite);

// Add key/value in levels deep using dot notation.
$newJson3->add('level1.level2.level3', 'a-deep-value', $overwrite);

// OR Add key/value in levels deep using an array.
$newJson3->add('level1', ['level2' => ['level3' => 'a-deep-level']], $overwrite);

/* Both (using dots or array) will create this:
{
...
    "level1": {
        "level2": {
            "level3": "deep-value"
        }
    },
...
}
*/

More examples

Features

  • Create and edit new JSON file
  • Edit existing JSON file
  • Use easy dot notation to get to your keys
  • Add/delete single or multiple keys at once
  • Bump version with seworqs/semver integration

See our examples

Classes and namespaces

Namespace Class Description
Seworqs\JsonEditor JsonEditor Nice JSON editor

License

Apache-2.0, see LICENSE

About SEworqs

Seworqs builds clean, reusable modules for PHP and Mendix developers.

Learn more at github.com/seworqs

Badges

Latest Version Total Downloads License PHP Version Made by SEworqs

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-04-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固