我有字符串组我想按组和子组爆炸
例如
operation.user.add
operation.user.edit
operation.permission.add
performance.tool.add
performance.tool.remove
operation.permission.edit
operation.tool.delete
operation.tool.remove
想要的结果如下:
Array
(
['operation'] => Array
(
['user'] => Array
(
[0] => 'add',
[1] => 'edit'
),
['permission'] => Array
(
[0] => 'add',
[1] => 'edit'
),
['tool'] => Array
(
[0] => 'delete',
[1] => 'remove'
),
),
['performance'] => Array
(
['tool'] => Array
(
[0] => 'add',
[1] => 'remove'
)
)
)
任何人都可以提供解决方案我如何将字符串转换为上述数组?