簡體   English   中英

解析xml文件-PHP-html標記

[英]Parse xml file - PHP - html tags

解決 :我已經使用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中,然后我想在我的網站上顯示它,但是我想在新行中添加一些句子,例如此輸出。

使用nl2br() php函數將<br />在每個新行上

nl2br php函數

例:

echo nl2br($arrayData['value']);
// this will replace all the new line character with <br />

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM