I have this following XML call from an API...
<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>
I'm just trying to understand how to recall the keycode
and the title
values... Using my simplexml_load()
...
I currently have set API call to $myXMLdata
:
$xmlFile = simplexml_load_string($myXMLData) or die("Error!!!");
echo $xmlFile->response->result->product->identifiers->store[1];
But it doesn't seem to return anything from the XML page.