我是新的编程-我从数据库检索信息,我必须显示这些项目每行3。下面是代码:
<?php
if($top) {
foreach($top as $val)
{
?>
<tr>
<?php for($c=0;$c<=3;$c++) { ?>
<td>
<img src="<?= $val['image']; ?>" style="width: 75px;height: 75px;"/>
</td>
<?php } ?>
</tr>
<?php
}
}
?>