使用 PHP 获取 XHTML 地图区域坐标
我在从下面的区域地图示例中获取属性时遇到问题,
<area shape="poly" class="areaSelect" coords="475,241,495,220,515,215,531,226,534,262,530,290,493,307,472,287" href="http://www.someURL" title="Area Title" alt="Link Title"/>
我一直在使用 simple_html_dom.php 从页面中检索其他元素。任何帮助将不胜感激。因为我一直在这方面反复思考,所以我确实尝试使用 Xpath 并加载 XHTML 文件,但是当我尝试获取坐标时,我只得到了 42 个“DOMAttr Object ()”案例,地图上有 42 个区域,但是.. .... 帮助!
I am having trouble getting the attributes from within an Area Map example below
<area shape="poly" class="areaSelect" coords="475,241,495,220,515,215,531,226,534,262,530,290,493,307,472,287" href="http://www.someURL" title="Area Title" alt="Link Title"/>
I have been using simple_html_dom.php to retrieve other elements from the page. Any help would be greatly appreciated. As I have been going around and around on this I did try using Xpath and loading the XHTML file but when I tried to get the coords I only got 42 cases of "DOMAttr Object ()" there is 42 areas on the map but...... help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我会尽力为其他想做类似事情的人提供尽可能多的细节。
这是一个快速示例文件。
好的,现在这是 php.ini。您需要下载“PHP Simple HTML DOM Parser”并将其加载到您的测试服务器上。以便您可以访问附加功能。
我已尝试彻底解释,但如果有人有任何进一步的问题或建议,我很乐意在这里提出
Ok I'll try and give as much details as I can for anyone else who wants to do something similar.
Here is a quick example file.
Ok now here is the php. You will need to download 'PHP Simple HTML DOM Parser' and load it onto your test server. so that you can access the additional functions.
I have tried to explain thoroughly but if anyone has any further questions or suggestions I would be happy to here them