前提是有一个test.xml文件
<?php $s=join("",file('test.xml')); $result = xml_to_array($s); function xml_to_array($xml) {