私はこのforeachを使ってYouTubeビデオギャラリーを構築しますが、各行ごとに3つのビデオを表示したいと思います。どのように3回ループするかを指定し、次のラインとループに3回移動します。私は1行ですべてのループを構築する必要がいけない.. ..このforeachループを制御する方法
table id="tblThumbsLayout" cellpadding="0" cellspacing="6">
<tr>
<?php foreach ($vcats as $vcat) { ?>
<td class="tdImg">
<div>
<?php echo '<iframe class="youtube-player" type="text/html" width=" 200 " height=" 100 " src="http://www.youtube.com/embed/' . $vcat['Video']['link'] . '"></iframe>' ;?>
<div class="text"><?php echo '<b>'. $vcat['Video']['title'].'</b>' ; ?></div>
</div>
</td>
<?php } ?>
</tr>
</table>
すべての回答に:最後の行でないことを忘れないでください。 – lvil