Using Xpath with PHP to parse HTML
My suggestion is to always use DOMDocument as opposed to SimpleXML, since it’s a much nicer interface to work with and makes tasks a lot more intuitive. The following example shows you how to load the HTML into the DOMDocument object and query the DOM using XPath. All you really need to do is find … Read more