有没有一种使用Zend Framework和PHP将XML转换为数组的方法?我看到有人使用SimpleXML来做到这一点,但我想知道是否有一种通过Zend Framework的方式。
我要转换为数组的示例XML如下:
转换后的数组将会像这样:
我要转换为数组的示例XML如下:
<library>
<book>
<authorFirst>Mark</authorFirst>
<authorLast>Twain</authorLast>
<title>The Innocents Abroad</title>
</book>
<book>
<authorFirst>Charles</authorFirst>
<authorLast>Dickens</authorLast>
<title>Oliver Twist</title>
</book>
</library>
转换后的数组将会像这样:
Array
(
[0] => Array (
[authorFirst] => Mark
[authorLast] => Twain
[title] => Innocents Abroad
)
[1] => Array (
[authorFirst] => Charles
[authorLast] => Dickens
[title] => Oliver Twist
)
)