내 프로젝트에서 나는 array.Please 해결 방법을 찾으려면 나를 도와주세요. 어레이가 아래에 나와 있습니다. 참조하십시오. 다음과 같습니다.다른 배열로 배열 변환
[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.
감사 :
[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
)
)
)
)
나는 내가 다음과 같은 방식으로 변환 할 array.Now 위의 종류가!
당신이 당신의 접근 방식 –
를 표시해야합니다 방법입니다 : 원래 배열을 통해 '반복'하여 y와 일치하도록 수정합니다. 우리의 의도 된 구조 –