【发布时间】:2014-05-20 05:06:20
【问题描述】:
我正在遍历一些数据并打印每一行。我对每一行都做同样的事情,除了在满足 for 循环之前的最后一行我想省略我打印的东西之一。这是我正在使用的代码。
$i = 5;
for($i=0; $i < $rsc; $i++) {
print("<div><p>Date</p></div><div><p>My Name</p></div>");
print("<div><p>Comment</p></div>");
//This next piece should not print on the last run through.
if(It's not the last one){
print("<div><p> My Section Break</p></div>");
}
}
【问题讨论】:
-
等等,我很困惑;又是什么问题? :)
-
问题已得到解答。等待 10 分钟。
标签: php html css loops for-loop