定制 vovan-ve/array-dumper 二次开发

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

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

vovan-ve/array-dumper

Composer 安装命令:

composer require vovan-ve/array-dumper

包简介

Dumper for constant arrays

README 文档

README

Latest Stable Version Latest Dev Version Build Status License

Dumps PHP array into pretty printed PHP code. Only constant data can be dumped, t.i. data, which can be used in const declaration since PHP 7.

Synopsis

use \VovanVE\array_dumper\ArrayDumper;

$dumper = new ArrayDumper();

$data = [
    'foo' => 42,
    'bar' => 'string',
    'list' => [10, 20, 30],
    'hash' => [
        'lorem' => 23,
        'ipsum' => true,
    ],
];

echo $dumper->dump($data);

Output:

[
    'foo' => 42,
    'bar' => 'string',
    'list' => [10, 20, 30],
    'hash' => [
        'lorem' => 23,
        'ipsum' => true,
    ],
]

Description

Simple array with sequential zero-based integer keys (aka lists) will be dumped in single line, unless the line became too long with indention, or lists nesting level became to deep (both are configurable).

An optional outer indent string can be supplied to dump() method. It is used internally for nested arrays. It can be anything you want including comment prefix // .

Notice: The library works only with UTF-8 strings. A string which is not valid UTF-8 in source data will encode invalid octets with \xFF escape codes. So, output dump always should be valid UTF-8 code.

Installation

Install through composer:

composer require vovan-ve/array-dumper

or add to require section in your composer.json:

"vovan-ve/array-dumper": "~1.0.0"

License

This package is under MIT License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固