leneko / flattener
(un)flatten php/json 数据结构
v1.0.1
2024-04-28 14:49 UTC
Requires
- php: ^8.3
- mnapoli/silly: ^1.9
Requires (Dev)
- ext-xdebug: *
- phpunit/phpunit: ^11.1
README
A lib for (un)flatten php data structure and a small cli for apply this on Json input.
用法
库
基本上,Flattener::flatten(...)
将这个
<?php [ 'hello' => [ 'world' => [ '!', '?' ], 'people' => [ 1, 2.3 ], ], 'bye' => null ]
转换成
<?php [ '.hello.world[0]' => '!', '.hello.world[1]' => '?', '.hello.people[0]' => 1, '.hello.people[1]' => 2.3, '.bye' => null, ]
(并且 Flattener::unflatten(...)
将反向操作)
命令行界面
获取帮助
bin/json-flatten --help
开发者
覆盖率
make coverage