doutang2382
2016-09-09 13:00
浏览 42
已采纳

如何在PHP中回显多行?

I am having a hard time where this code

<div class = "col-md-8">
     <?php echo $row['actualpost']; ?>
</div>

is overlapping the column in a div. How can we multi line this?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • doupai8533 2016-09-09 13:06
    已采纳

    You can wrap your string using wordwrap() function like this:

    wordwrap($row['actualpost'], 10, '<br>');
    

    This function will wrap your long string into multiline.

    Or

    You can use this css for your div

    word-wrap: break-word;
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • duanpu4143 2016-09-09 13:07

    try this it's work

    <div class = "col-md-8">
     <?php echo $row['actualpost']; ?>
    </div>
    
    评论
    解决 无用
    打赏 举报
  • douchen4547 2016-09-09 13:32

    In CSS :

    .col-md-8
    {
       width:100%;
       word-wrap: break-word;
    }
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题