Please note, this is a STATIC archive of website teamtutorials.com from July 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.

Parsing XML Feed to an Array with XPath

Recently while working on a project, I found myself needed to parse several different types of files through the same mechanism (CSV, pipe delimited, XML, and more). I decided that it would be best to get each time of feed to a identical object that could then be run through the same methods regardless of the input type. This tutorial will walk you through using PHP and XPath to parse the values from an XML file and store them into array for later manipulation.