I have a nested array like so
$array = array(
[2] => array(
[5] => array(
[7] => array(
[46] => array()
)
),
[108] => array()
),
[14] => array(),
[8] => array(
[72] => array()
)
)
With only knowing the key, I need to find it in the array and get all it's nested data. Using array_column only works if I start with a second level key
$foo = array_column($array, 2) // returns empty array
$bar = array_column($array, 5) // returns all its nested data
Why is that and what's the correct way to do this with any key without knowing the level