标签: php arrays multidimensional-array
我有这样的代码:
$data = []; $data['key1']['key2']['key3'] = 123;
然后,我需要从这个数组获取数据是这样或类似的方式:
$path = "['key1']['key2']['key3']"; echo $data[$path]; # should return 123
有什么想法吗?
谢谢!