这是php for循环的开始.我想编辑它,以便'INSERT NUMBER HERE'被替换为递增的数字.IE浏览器.第一个循环它将是1,然后是2,然后是3等.
<?php foreach ($_productCollection as $_product): ?>
<div style="float: left; font-size: 120px;height:50px;padding-top:50px; color:#ccc">INSERT NUMBER HERE</div>
<div class="listing-item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
谢谢
dfi*_*ovi 13
<?php
$n = 0;
foreach ($_productCollection as $_product):
$n++;
?>
<div style="float: left; font-size: 120px;height:50px;padding-top:50px; color:#ccc"><?php echo $n; ?>
</div>
<div class="listing-item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
26483 次 |
最近记录: |