我有一個這樣的數組。PHP - 展平陣列
Array
(
[0] => Array
(
[category] => vegetable
[type] => garden
[children] => Array
(
[0] => Array
(
[name] => cabbage
)
[1] => Array
(
[name] => eggplant
)
)
)
[1] => Array
(
[category] => fruit
[type] => citrus
)
)
什麼是一種簡單的方法來構建這樣使用PHP的結果數組?
Array
(
[0] => Array
(
[category] => vegetable
[type] => garden
[name] => cabbage
)
[1] => Array
(
[category] => vegetable
[type] => garden
[name] => eggplant
)
[2] => Array
(
[category] => fruit
[type] => citrus
)
)
我目前正在爲此解決方案。
的可能重複[如何 「扁平化」 的多維數組簡單的在PHP?](http://stackoverflow.com/questions/526556/how-以平面多維陣列到簡單的一個在php) – 2014-09-29 19:57:46
@MarinAtanasov這似乎並不是一個案例。那裏沒有關聯數組。 – 2014-09-29 20:03:06