【发布时间】:2012-03-18 17:30:22
【问题描述】:
我正在尝试将来自 xml 的结果回显到我的 html 代码表单 expedia 中。但是我遇到了一个问题。里面的文字有点乱:
<areaInformation>
Distances are calculated in a straight line from the property's location to the point of interest or attraction, and may not reflect actual travel distance. <br /><br /> Distances are displayed to the nearest 0.1 mile and kilometre. <p>La Isla Shopping Mall - 0.5 km / 0.3 mi <br />Yamil Lu'um - 0.5 km / 0.3 mi <br />Acuario Interactivo - 0.6 km / 0.3 mi <br />Luxury Avenue - 1.5 km / 0.9 mi <br />Cancun Golf Club at Pok Ta Pok - 2.2 km / 1.3 mi <br />Nautilus Diving and Training Center - 2.6 km / 1.6 mi <br />Cancun Convention Center - 2.8 km / 1.7 mi <br />Plaza Caracol - 2.8 km / 1.8 mi <br />Playa Tortuga - 3.1 km / 1.9 mi <br />Aquaworld - 3.6 km / 2.2 mi <br />Playa Langosta - 4.1 km / 2.6 mi <br />Museo de Arte Popular Mexicano - 4.6 km / 2.9 mi <br />Playa Linda - 5 km / 3.1 mi <br />Playa Delfines - 6.1 km / 3.8 mi <br />El Rey Ruins - 6.2 km / 3.8 mi <br /></p><p>The preferred airport for ME Cancun - Complete ME All Inclusive is Cancun, Quintana Roo (CUN-Cancun Intl.) - 14.3 km / 8.9 mi. </p>
</areaInformation>
我在 php 中回显它:
<div id="hotelInfo"><?php echo $areaInfo ?></div>
当然,我在浏览器窗口中得到了这个:
Distances are calculated in a straight line from the property's location to the point of interest or attraction, and may not reflect actual travel distance. <br /><br /> Distances are displayed to the nearest 0.1 mile and kilometre. <p>La Isla Shopping Mall - 0.5 km / 0.3 mi <br />Yamil Lu'um - 0.5 km / 0.3 mi <br />Acuario Interac
等等
我该如何解决这个问题???任何帮助将不胜感激!谢谢! 我希望它输出没有任何 html 标签的普通文本。
【问题讨论】:
-
编辑 XML 文件并使用
-
究竟是什么问题?您给我们输入和错误输出,好的,但也给我们期望的输出以帮助我们了解您的需求。
-
我希望它输出没有任何html标签的普通文本。