如何为以下产品形成创建for / while循环?

时间:2013-11-27 09:40:00

标签: php .net entity-framework product

我正在使用数据库检索产品。

我想以下列模式显示产品。

什么是php或.net循环代码?帮助

<div class="big-row">
        <div class="first-row-left">
            <div class="product-1a">Product1</div>
            <div class="product-1a">Product2</div>
            <div class="product-1a">Product3</div>
            <div class="product-1b">Product4</div>
            <div class="product-1b">Product5</div>
            <div class="product-1b">Product6</div>
        </div>
        <div class="first-row-right">
            <div class="bigproduct-right">Product7</div>
        </div>
    </div>
    <div class="single-row">
        <div class="product-single-row">Product8</div>
        <div class="product-single-row">Product9</div>
        <div class="product-single-row">Product10</div>
        <div class="product-single-row">Product11</div>
        <div class="product-single-row">Product12</div>
    </div>

1 个答案:

答案 0 :(得分:0)

<div class="big-row">
        <div class="first-row-left">
     <?php    
        for($i = 0, $intSize = sizeof($arr); $i < $intSize ; $i++){ 
     ?>         <div class="product-1a"><?php echo $arr['product']; ?></div>
     <?php 
         }
     ?> 
         </div>

for循环的一个小例子