0

已解决:我使用 nl2br 来达到我的目标。

我使用 SofeeXmlParser 解析 xml 文件。除其他外,该文件还包括说明。我需要在新行的描述中添加一些句子。是否可以?

这种描述的输出看起来:

(
    [value] =>  
TEXT TEXT TEXT TEXT TEXT 

Text text text, text text text text text text.   

 Text text text, text text text text text text.  Text text text, text text text     

 Text text text, text text text text text text.    Text text text, text text text text text text.    Text text text, text text text text text text.   

 TEXT TEXT TEXT.     
  )

我将 xml 文件的输出放入 mysql,然后我想在我的网站上显示它,但我想在新行中有一些句子,就像在这个输出中一样。

4

1 回答 1

0

使用nl2br()php 函数放置<br />每个新行出现

nl2br php函数

例子:

echo nl2br($arrayData['value']);
// this will replace all the new line character with <br />
于 2012-05-18T07:06:20.483 回答