如何使用array_column
进行深度搜索?
例如,我有这个数组:
Array
(
[0] => Array
(
[id] => 100
[url] => Home
[parent_id] => 0
[children] => Array
(
)
)
[1] => Array
(
[id] => 101
[url] => About
[parent_id] => 0
[children] => Array
(
[99] => Array
(
[id] => 102
[url] => Group
[parent_id] => 101
[children] => Array
(
)
)
)
)
)
代码:
var_dump(array_search(102, array_column($new_items, 'id')));
结果:
bool(false)
我希望得到:
99
有什么想法吗?