流程控制实战
一、图片判断
<?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
}
?>