3
我將以下XML文件加載到php simplexml中。simplexml,返回具有相同標記的多個項目
<adf>
<prospect>
<customer>
<name part="first">Bob</name>
<name part="last">Smith</name>
</customer>
</prospect>
</adf>
使用
$customers = new SimpleXMLElement($xmlstring);
這將返回 「鮑勃」,但我怎麼回的姓氏?
echo $customers->prospect[0]->customer->contact->name;
+1爲漂亮的手動鏈接! – hakre 2012-08-15 20:13:34
謝謝,正是我在找的! – bmanhard 2012-08-16 14:49:10