How can I do deep search with array_column?
For instance, I have this array:
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
(
)
)
)
)
)
Code:
var_dump(array_search(102, array_column($new_items, 'id')));
result:
bool(false)
I am hoping to get:
99
Any ideas?
array_columnis not recursive, it just returns the values from the top-most array.