拆开想,
1.取到商品数组
2.用foreach进行循环
3.循环内进行每个商品折扣计算
4.把结果传到网页
5.在网页中用循环把新数组循环
例如:<table>
<tr>
<td>价格</td>
<td>折扣后价格</td>
</tr>
<?php foreach($goods as $k=>$v){?>
<tr>
<td><?php echo $v['price'];?></td>
<td><?php echo $v['new_price'];?></td>
</tr>
<?php }?>
</table>