在我的项目中,我有以下类型的数组。请帮助我找到解决方案。数组如下,请参考。它看起来像以下。
[0] => Array
(
[Notification] => Array
(
[id] => 135
[notification_date] => 2013-09-18
[short_desc] => dsfdfdfdf
[long_desc] =>
)
[NotificationProduct] => Array
(
[0] => Array
(
[id] => 41
[notification_id] => 135
[product_id] => 20
[Product] => Array
(
[id] => 20
[category_id] => 2
[name] => asasasa
)
)
[1] => Array
(
[id] => 42
[notification_id] => 135
[product_id] => 21
[Product] => Array
(
[id] => 21
[category_id] => 2
[name] => corn flakcf
)
)
)
)
我有上述类型的数组。现在我想将其转换为以下方式:
[0] => Array
(
[Notification] => Array
(
[id] => 135
[notification_date] => 2013-09-18
[short_desc] => dsfdfdfdf
[long_desc] =>
)
[NotificationProduct] => Array
(
[0] => Array
(
[id] => 41
[notification_id] => 135
[product_id] => 20
[name] => asasasa
)
[1] => Array
(
[id] => 42
[notification_id] => 135
[product_id] => 21
[name] => corn flakcf
)
)
)
Is there any way to convert it into that kind of array.
谢谢!