Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.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中回显多行?_Php_Html - Fatal编程技术网

如何在PHP中回显多行?

如何在PHP中回显多行?,php,html,Php,Html,我很难理解这段代码 <div class = "col-md-8"> <?php echo $row['actualpost']; ?> </div> 与div中的列重叠。我们如何将其多行?您可以使用wordwrap()函数像这样包装字符串: wordwrap($row['actualpost'], 10, '<br>'); 试试这个,这是工作 <div class = "col-md-8"> <?php ec

我很难理解这段代码

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


div中的列重叠。我们如何将其多行?

您可以使用
wordwrap()
函数像这样包装字符串:

wordwrap($row['actualpost'], 10, '<br>');
试试这个,这是工作

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

在CSS中:

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

什么
应该可以完成这项工作。不确定这是复制还是粘贴错误,但您在键入sir时缺少PHP结束标记的
错误sorry@PrafullaKumarSahu是的,先生,它会打印。顺便问一下,10是多少?一行的最大长度,在这个长度之后,您的线路将中断
,应该是这样吗?@louchinvarjaryes@LouchinVarCariasCejar但是为什么只使用一个字符的行长?很抱歉,没有输入错误,但这不是答案…你想要的是?它在div中重叠,我希望它是多行的,参考这个链接它的help you@LouchinVarCariasCejar,这并不意味着不能发布更多的答案。
.col-md-8
{
   width:100%;
   word-wrap: break-word;
}