xml转换数组

来源:互联网 发布:淘宝卖显卡怎么保修 编辑:程序博客网 时间:2024/06/06 13:14

php xml格式 转换数组

$xml = ''<notify>
<note>
<to>George</to>
<from>John</from>
<heading>Reminder</heading>
<body>Don\'t forget the meeting!</body>
</note>
</notify>'; 

$xml = simplexml_load_string($xml)

$note= (array)$xml->note;