<?xml version="1.0"?>
<ABCD xmlns="http://abcd.com">
<PRODUCT xmlns="">
<CNHEADER>
<CNTRACK>true</CNTRACK>
<FIELD name="PRODUCTNO" value="BK201122"/>
<FIELD name="ProductType" value="DP"/>
<FIELD name="strProdCode" value="NL1754"/>
Here i want the value of PRODUCTNO and so on.
i tried this but still not getting any output
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url); // get the url contents
$data = curl_exec($ch); // execute curl request
curl_close($ch);
$xml = simplexml_load_string($data);
echo $value = (string) $xml->FIELD[0]->attributes()->name;