简体   繁体   中英

How do I echo multiple lines in 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?

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;

try this it's work

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

In CSS :

.col-md-8
{
   width:100%;
   word-wrap: break-word;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM