繁体   English   中英

无法将XML数据显示为HTML

[英]Unable to display XML data as HTML

我已经从网址加载了xml文件

$xml = simplexml_load_file($xml_url);

但是,当我用php回显时,我的浏览器无法读取XML的HTML标签。

echo $child->description;

它显示如下内容。

<p> The secadition.</p> <p> Time isbt. <em>As offignity.</em></p>

无论如何,使HTML标记可被浏览器读取?

在XML中

    <description>
&lt;p&gt;
 The secret of our success is very simple - we respect our clients, provide them only with the high quality commodities and work only with the best and the most reliable suppliers. What we offer is not just the reliable mechanisms, we offer stylish and desired watches that will present you as the owners of prestigious tradition.&lt;/p&gt;
 &lt;p&gt;
 Time is priceless, without a doubt. &lt;em&gt;As official time providers we will help you appreciate your time and with our watches you will do that with style and dignity.&lt;/em&gt;&lt;/p&gt;
</description>

更新

html_entity_decode() will solve this problem

您可能需要取消转义html实体

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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