我无法从此多维数组检索所有数据。我已经使用foreach循环进行了编码,但是由于内部循环无法正常工作,因此显示错误。请帮助我。这是我尝试过的代码 foreach($capture as $k) { foreach($k['ReportLines'] as $detail){ echo $detail['Quantity']; echo $k['Description']; } }这是数组 $capture= Array([ReportLines] => Array([0] => Array( [Quantity] => 4.00 [Item] => MISPM [Description] => Midnight [Price] => 30.00 [Amount] => 120.00 ) [1] => Array( [Quantity] => 40.00 [Item] => BMISPM [Description] => Midnight2 [Price] => 340.00 [Amount] => 1220.00 ) [2] => Array( [Quantity] => 24.00 [Item] => AMISPM [Description] => Midnight3 [Price] => 3250.00 [Amount] => 1220.00 ) ([3] => Array( [Quantity] => 34.00 [Item] => MIeSPM [Description] => Midnight [Price] => 30.00 [Amount] => 120.00 ) ))
1 回答
FFIVE
TA贡献1797条经验 获得超6个赞
尝试这种方式:
foreach($capture['ReportLines'] as $detail) {
echo $detail['Quantity'];
echo $detail['Description'];
}
对不起,我的回复很快,但我是从电话写的。
- 1 回答
- 0 关注
- 103 浏览
添加回答
举报
0/150
提交
取消