我不知道这是什么类型的XML,以及如何在PHP中使用simplexml读取它...
<abc:documents count="1">
<def:doc>
<def:serial-item>
<ghi xml:lang="en" version="5.1">
<item-info>...</item-info>
<jkl:something>...</jkl:something>
<head>...</head>
<body view="all">...</body>
</ghi>
</def:doc>
</abc:documents>
当我这样做时:
$xml = simplexml_load_file('file.xml'); //with above content
var_dump($xml);
我明白了:
object(SimpleXMLElement)#1(1){[“@attributes”] =&gt; array(1){ [ “计数”] =&GT; string(1)“1”}}