Tutorial on using PHP to parse HTML files and extract links using pcre regex regexp regular expression patterns.
If your PHP applications perform beyond CRUD operations, chances are you have worked with XML. Navigating an XML document or data stream for the desired data elements can be cumbersome, though, and even somewhat intimidating for PHP developers. It can be especially overwhelming when the XML data structure is complex. XPath is a W3C standard whose sole purpose is just that -- getting to the right data element, or, specifically, the desired node. PHP supports XPath as part of its XML classes and functions. In this article you explore some basic scenarios for locating information in XML and how XPath can do the hard work for you in your PHP applications.
Source: Using XPath with PHP