我有以下来自API的XML调用...
<response xmlns="http:/xml-api">
<result id="123123" status="Success">
<product>
<identifiers>
<store>
<keycode>abcdefghi123</keycode>
<title>Sweet Dreams Are Made out of these</title>
</store>
<location>
<origin>South Africia</origin>
<current>Brazil</current>
</location>
</identifiers>
</product>
</result>
</response>
我只想了解如何回忆keycode
和title
值...使用我的simplexml_load()
...
我目前已将API调用设置为$myXMLdata
:
$xmlFile = simplexml_load_string($myXMLData) or die("Error!!!");
echo $xmlFile->response->result->product->identifiers->store[1];
但它似乎没有从XML页面返回任何内容。