【发布时间】:2012-05-18 11:31:03
【问题描述】:
这是我的输出 XML 示例的样子:
<item>
<Barcode>0602527522593</Barcode>
<albumid>1818</albumid>
<Title>Gold</Title>
<Country>Sweden</Country>
<Format>CD</Format>
<Length></Length>
<Number_of_Discs></Number_of_Discs>
<Type>album</Type>
<Description></Description>
<Band_or_Artist>Adams, Ryan</Band_or_Artist>
</item>
是否有易于使用的内置 PHP 函数或插件快速将其转换为 JSON 并输出?如果不是内置的,我应该使用哪个扩展?
【问题讨论】:
-
既然您说此 XML 是您的输出,那么从您的源数据中生成 JSON 可能比生成 XML 然后将其转换为 JSON 更容易。数据从何而来?
标签: php javascript xml json