dougang6178 2019-04-05 00:10
浏览 160
已采纳

自动<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 2019-04-05 00: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; ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?