我想通過使用foreach循環來獲取數組父索引或 第一級'1006'之一的值,但沒有太大的運氣。我可以在這裏使用一些幫助來獲取給定數組組的子數據或子數據。如何從多維數組組索引輸出數據
Array (
[1004] => Array (
[0] => Array ([od_id] => 1004 [pd_id] => 42 [pd_name] => Red Hat)
[1] => Array ([od_id] => 1004 [pd_id] => 33 [pd_name] => Green Hat)
[2] => Array ([od_id] => 1004 [pd_id] => 44 [pd_name] => Blue Hat)
)
[1006] => Array (
[0] => Array ([od_id] => 1006 [pd_id] => 33 [pd_name] => Green Hat)
[1] => Array ([od_id] => 1006 [pd_id] => 44 [pd_name] => Blue Hat)
[2] => Array ([od_id] => 1006 [pd_id] => 41 [pd_name] => Pink Hat)
)
[1007] => Array (
[0] => Array ([od_id] => 1007 [pd_id] => 29 [pd_name] => Purple Hat)
[1] => Array ([od_id] => 1007 [pd_id] => 24 [pd_name] => Orange Hat)
[2] => Array ([od_id] => 1007 [pd_id] => 44 [pd_name] => Blue Hat)
)
)
我寧願有結果分配給像
而不是字符串的新數組。感謝您的輸入。 –