dougang6178
2019-04-05 08:10 阅读 142
已采纳

自动<p>标签?

I have a "Public Profile" page, which shows infomation about users, but I have a certain one which is (Tidl poster) which automaticly adds an paragraph around it.

I've already tried looking up the code, and strip html tags, this does not help tho.

<?php if ( ! empty( $member['tidligere_poster'] ) ) : ?>
    <?php
    $text = strip_tags($member['tidligere_poster']);
    ?>
    <div class="form-group">
        <div class="input-group">
            <span class="input-group-addon"><i class="fa fa-fw fa-trophy"></i> Tidl. Poster</span>
            <input type="textarea" value="<?php echo $text; ?>" class="form-control" height="10px" disabled>

        </div>
    </div>
<?php endif; ?>

I want it to show up without the <p> tag, how do i achieve this?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dtwr2012 dtwr2012 2019-04-05 08:33

    Try html_entity_decode with strip_tags on this Code.

              <?php if ( ! empty( $member['tidligere_poster'] ) ) : ?>
                   <?php  $text = strip_tags(html_entity_decode($member['tidligere_poster'])); ?>  
                          <div class="form-group">                     
                               <div class="input-group">                                  
                                     <span class="input-group-addon"><i class="fa fa-fw fa-trophy"></i> Tidl. Poster</span>
                                     <input type="textarea" value="<?php echo $text; ?>" class="form-control" height="10px" disabled>
                               </div>
                           </div>
             <?php endif; ?>
    
    点赞 评论 复制链接分享

相关推荐