[英]php html parsing using DOMXPath
I have html like this: 我有这样的HTML:
<span><b>Company: </b> Nirmal Datacomm Pvt Ltd<br> <b>location: </b> Mumbai<br> <b>Ref: </b> 8560918<br> </span>
I want to extract the bold text and the text immediately following it into an array like the following: 我想将粗体文本和紧随其后的文本提取到如下数组中:
array('company'=>'Nirmal DataComm Pvt Ltd','location'=>'Mumbai','ref'=>'8560918')
I am new to PHP. 我是PHP新手。 By going through related questions, I learnt that it can be done using DOMXPath (if i'm not wrong).
通过研究相关问题,我了解到可以使用DOMXPath来完成(如果我没有记错的话)。 I read several other examples about using DOMXPath but could not get any clue for query.
我阅读了有关使用DOMXPath的其他几个示例,但无法获得任何查询线索。
Any help appreciated. 任何帮助表示赞赏。
Thanks and Regards 谢谢并恭祝安康
Chandra 钱德拉
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.