次のような配列があります。
$a = [
1 => [
'title' => 'test',
'items' => [
5 => [
'title' => 'hello',
'items' => []
]
]
],
2 => [
'title' => 'second',
'items' => [
7 => [
'title' => 'hello in second',
'items' => []
]
]
],
3 => [
'title' => 'third',
'items' => [
10 => [
'title' => 'hello in third',
'items' => []
]
]
],
];
ツリーのどこにいても、キーでその一部を抽出する方法が必要です。いくつかの方法を試しましたが、どれだけ効率的かはわかりません。それが役立つ場合は、数字キーを持つ部分のみを抽出する必要があります。どんな助けでも大歓迎です。