A lib for (un)flatten php data structure and a small cli for apply this on Json input.
Basically, Flattener::flatten(...)
turn this
<?php
[
'hello' => [
'world' => [
'!', '?'
],
'people' => [
1, 2.3
],
],
'bye' => null
]
into
<?php
[
'.hello.world[0]' => '!',
'.hello.world[1]' => '?',
'.hello.people[0]' => 1,
'.hello.people[1]' => 2.3,
'.bye' => null,
]
(And Flattener::unflatten(...)
will play this backward)
Get help
bin/json-flatten --help
make coverage