I have a simple xml string. I am trying to convert it into xml and need to save 2 records in DB for it. First node will go seperate record and 2nd node will go as a seperate record. But it's not working. This is string.
$getXml = '<Nodes>
<NODE>
<RANGE-START>200</RANGE-START>
<RANGE-END>244</RANGE-END>
<QTY>45</QTY>
</NODE>
<NODE>
<RANGE-START>50</RANGE-START>
<RANGE-END>52</RANGE-END>
<QTY>2</QTY>
</NODE>
</NODES>
';
This is code
$xml=simplexml_load_string($getXml);
foreach( $xml->node as $item )
{
echo $arrXml = $item->{'RANGE-START'};
}