第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 IF PHP 中嵌入引導程序容器

在 IF PHP 中嵌入引導程序容器

PHP
慕田峪7331174 2023-03-26 14:48:43
首先,我嘗試了幾乎所有類似問題的解決方案,但我無法得到結果。我正在嘗試更換設計以顯示一些數(shù)據(jù)。我已將產(chǎn)品列表存儲在$prods = array()因此,當我嘗試讓這些產(chǎn)品改變它們在網(wǎng)頁上的顯示方式時,我做了如下操作:$aux = count($prods);foreach($prods as $key => $value):?><?php if($aux%2 == 0): ?><html>    <div class="container">        <div class="row justify-content-around my-3">            <figure class="col-6 figure my-3 row justify-content-center">                <img style="height: 20vw" src="imagenes/d3.jpeg" class="figure-img img-fluid rounded" alt="...">            </figure>            <div class="col-6 row justify-content-around">                <div class="col row align-items-center">                    <div class="col display-3"><?php $value ?></div>                    <div class="col-12 display-5">Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam saepe ipsum quod nesciunt labore magni a perspiciatis sunt officia facere, reprehenderit praesentium explicabo ipsa eligendi! Cumque nulla reiciendis perferendis sequi.</div>                    <p class="col-12 lead">Precio: Lorem, ipsum dolor.</p>                </div>            </div>        </div>    </div></html><?php $aux = $aux-1; ?><?php else: ?><html>    <div class="container">        <div class="row justify-content-around my-3">            <div class="col-6 row justify-content-around">            <div class="col row align-items-center">                    <div class="col-12 display-3"><?php $value ?></div>                    <div class="col-12 display-5">Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam saepe ipsum quod nesciunt labore magni a perspiciatis sunt officia facere, reprehenderit praesentium explicabo ipsa eligendi! Cumque nulla reiciendis perferendis sequi.</div>                <p class="col-12 lead">Precio: Lorem, ipsum dolor.</p>                </div>            </div>        </div>    </div></html><?php $aux = $aux-1; ?><?php endforeach;?>當我運行它時只得到空白結果。沒有html代碼。我是 PHP/HTML/MongoDB 的新手,所以我正在努力學習!感謝您。
查看完整描述

1 回答

?
冉冉說

TA貢獻1877條經(jīng)驗 獲得超1個贊

通常如果你的$prod不為空,這應該有效:


<?php

$aux = count($prods);

?>

<html>

<body>


<?php

foreach($prods as $key => $value){

    if($aux%2 == 0){ ?>

        <div class="container">

            <div class="row justify-content-around my-3">

                <figure class="col-6 figure my-3 row justify-content-center">

                    <img style="height: 20vw" src="imagenes/d3.jpeg" class="figure-img img-fluid rounded" alt="...">

                </figure>

                <div class="col-6 row justify-content-around">

                    <div class="col row align-items-center">

                        <div class="col display-3"><?php $value ?></div>

                        <div class="col-12 display-5">Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam saepe ipsum quod nesciunt labore magni a perspiciatis sunt officia facere, reprehenderit praesentium explicabo ipsa eligendi! Cumque nulla reiciendis perferendis sequi.</div>

                        <p class="col-12 lead">Precio: Lorem, ipsum dolor.</p>

                    </div>

                </div>

            </div>

        </div>

        <?php $aux = $aux-1; } else {?>


        <div class="container">

            <div class="row justify-content-around my-3">

                <div class="col-6 row justify-content-around">

                    <div class="col row align-items-center">

                        <div class="col-12 display-3"><?php $value ?></div>

                        <div class="col-12 display-5">Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam saepe ipsum quod nesciunt labore magni a perspiciatis sunt officia facere, reprehenderit praesentium explicabo ipsa eligendi! Cumque nulla reiciendis perferendis sequi.</div>

                        <p class="col-12 lead">Precio: Lorem, ipsum dolor.</p>

                    </div>

                </div>


                <figure class="col-6 figure my-3 row justify-content-center">

                    <img style="height: 20vw" src="imagenes/d.jpeg" class="figure-img img-fluid rounded" alt="...">

                </figure>


            </div>

        </div>

        <?php $aux = $aux-1; ?>


    <?php }};?>


</body>


</html>



查看完整回答
反對 回復 2023-03-26
  • 1 回答
  • 0 關注
  • 122 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號