我有一個顯示<li>
一個循環的,我需要一個類添加到第1次,然後每六個<li>
的PHP李計師
例子:
while ($db_field = mysql_fetch_assoc($result)) {
<li (if mod of 6 add class="something")>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
<li>Five</li>
<li class="something">Six</li>
<li>Seven</li>
}
...
是未來的動態? – diEcho
是的,它從數據庫中讀取記錄 – Satch3000
'IF($ i%6 == 0)add the class' – Shubham