MSBWare.com: XML to Array

Courtesy PHPDeveloper.org  Mon, 04/14/2008 - 10:23

Michael has posted a simple script today that takes in XML data and spits back out an array on the other side:

The function takes the specified XML data (which must be in valid XML format) and converts into an array.

Any attributes in the XML elements are dropped an only the element values are placed in the array.

The code uses a combination of XPath, DOM, and regular expressions to parse the given XML content.

Sponsors


 

Related items

PHP in Action: Get links with XPath
In response to this tutorial over on the PHPro.org website a new post has been made to the PHP in Action blog with an "even cooler" way to do the...

ThinkPHP Blog: Accessing Nike+ data with PHP
On the ThinkPHP blog today, Stephanie Ehrling has posted about a method for PHP to take in the output of the Nike+ equipment and put it into a...

Accessing Nike+ data with PHP - ThinkPHP /dev/blog - PHP
Nike+ is a feature for the iPod nano which allows to measure time, distance and speed of runnings with a small sensor in running shoes that sends...

The Silver Lining in OOXML Approval
451 CAOS Theory: "I kept waiting to weigh in on the ISO approval of Microsoft's Office Open XML format, searching for some kind of silver lining for...


 

Post new comment

The content of this field is kept private and will not be shown publicly.
computer-internet.marc8.com