我有一個PHP文件,它讀取XML文件並使用for循環將數據顯示爲HTML5 <article>
對象。所有這一切都像一個冠軍。我遇到的問題似乎與XML文件本身中的數據有關。我的數據與此類似:XML數據中的超鏈接不顯示在PHP文件中
<articles>
<article>
<num>1</num><text>This is one.</text>
</article>
<article>
<num>2</num><text>This is <a href='./two.htm'>two</a>.</text>
</article>
<article>
<num>3</num><text>This is three.</text>
</article>
</articles>
我加載XML這樣的:
$xml = simplexml_load_file("./articles_test.xml");
輸出看起來是這樣的:
This is one.
This is .
This is three.
我試圖逃跑,報價,用HTML實體名稱和一些其他的東西無濟於事。感謝幫助。謝謝。
你可能會嘗試在'href'而不是''''周圍放置'''',以確保不會造成任何問題。 – dfockler