【阿里云】各类产品,精心挑选的热门优惠云产品,总有一款适合你的业务形态【腾讯云】爆款2核2G云服务器首年40元,企业首购最高获赠300元京东卡

流程控制实战


一、图片判断

<?php
    if(isset($article_v['img'])){
?>
    <img style="width:200px;height:100px;" src="<?php echo $article_v['img'] ?>" alt="" />
<?php
    }
?>

二、标题判断

<?php
    if(!empty($article_v['content'])){
?>
    <header class="entry-header">
        <h1 class="entry-title">
            <a href="/details.html" title="<?php echo $article_v['title'] ?>" rel="bookmark"><?php echo $article_v['title'] ?></a>
        </h1>
    </header>
<?php
    }
?>

三、分类判断

<?php
    if(isset($article_v['class'])){
?>
    <a href="/index.html?cate=2" rel="category"><?php echo $article_v['class'] ?></a> 分类
<?php
    }
?>