doujiang1913 2017-06-19 11:46
浏览 83
已采纳

如果php echo内容为空,则隐藏div

<div class="botontour"><a href="<?php echo $currentItem['video'];?
>">Video Tour 3D</a></div>

I want to hide the entire "botontour" div if the php echo has no return.

  • 写回答

4条回答 默认 最新

  • doudouba4520 2017-06-19 11:50
    关注

    in this case you can check if it's empty :

    <?php
    if (!empty($currentItem['video'])) {
    ?>
        <div class="botontour"><a href="<?= $currentItem['video'];?>">Video Tour 3D</a></div>
    <?php
    }
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?