我正在尝试通过使用 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 )
)
)