Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何防止输出html标签?_Php - Fatal编程技术网

Php 如何防止输出html标签?

Php 如何防止输出html标签?,php,Php,我目前拥有的代码是: <h2 id="comment_title">vistor comments</h2> <div class="count"> <?php $count = comment_num($nid); if($count>0){ echo $count'comments'; } else { echo ''; } ?> </di

我目前拥有的代码是:

<h2 id="comment_title">vistor comments</h2>  
<div class="count">
  <?php 
    $count = comment_num($nid);
    if($count>0){
        echo $count'comments';
    } else {
        echo '';        
    }
  ?>
</div>
$count
访客评论时
如果($count>0){//把你想要回显的所有东西都放在这里}
否则{echo';}
是无用的;你可以把它取下来。
<h2 id="comment_title">vistor comments</h2>and $count'comments';
<h2 id="comment_title">vistor comments</h2> ;
<h2 id="comment_title"><?php echo $count?> visitor comments</h2></div>