I have fetched the contents from a url using CURL which is in the form of XML. But i want to separate the contents in the form of variables which i tried doing using "simplexml_load_string". My contents from the url are:-
<GetGPSRawDataResponse xmlns="http://example.org/">
<GetGPSRawDataResult>
[{"IMIENO":"35xxxxxxxxxxx","Lattitude":24.4286285,"Longitude":73.0507245,"Altitude":0.000,"Speed":0.000,"CTime":"Jul 8 2015 7:24:02:000PM","RecordTime":"Jul 9 2015 8:46AM","DevDistance":0.1000,"CardID":""},{"IMIENO":"35xxxxxxxxxx","Lattitude":24.4286285,"Longitude":73.0507245,"Altitude":0.000,"Speed":0.000,"CTime":"Jul 8 2015 7:19:02:000PM","RecordTime":"Jul 9 2015 8:49AM","DevDistance":0.0950,"CardID":""}]
</GetGPSRawDataResult></GetGPSRawDataResponse>
I tried fetching the contents from the xml like:-
$abc=get_data($url);//get_data is a function that is working to fetch url contents
//After fetching the above contents from the url.
I did $xml_retrieve=simplexml_load_string($abc);
but the $xml returns nothing. I dont understand why? I want to get the latitude and longitude from the above contents But I dont understand where m i doing wrong if this is the only way