<?php foreach ($data as $k => $v): ?>
<tr class="tron">
<td align="center"><?php echo $v['id']; ?></td>
<td align="center" class="first-cell"><span><?php echo $v['goods_name']; ?></span></td>
<td align="center"><?php showImage($v['sm_logo']); ?></td>
<td align="center"><?php echo $v['market_price']; ?></td>
<td align="center"><?php echo $v['shop_price']; ?></td>
<td align="center"><?php echo $v['is_on_sale']; ?></td>
<td align="center"><?php echo $v['addtime']; ?></td>
<td align="center">
<a href="<?php echo U('edit?id='.$v['id']); ?>">修改</a>
<a οnclick="return confirm('确定要删除吗?');" href="<?php echo U('delete?id='.$v['id']); ?>">删除</a>
</td>
</tr>
<?php endforeach; ?>
在html中写php的foreach例子
最新推荐文章于 2022-03-21 13:25:21 发布