I want to read some data from an xml feed and show it on a webpage using php. This is the feed URL: http://api.autoit.dk/car/GetCarsExtended/391B093F-BB4A-45AA-BEFF-7B33842401EA
I have been told that the service is able to return both JSON and XML, depending on what the client accepts in the header content type. I have been trying to go with XML, but I get some errors:
Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /home/www/flexto.dk/test.php on line 3
Warning: simplexml_load_string(): [{"ComId":4712,"Husnr":10,"Navn":"Flexto A/S","By":"Støvring","Postnr":9530,"Ad in /home/www/flexto.dk/test.php on line 3
Warning: simplexml_load_string(): ^ in /home/www/flexto.dk/test.php on line 3 Error: Cannot create object
It should be pretty simple, but I haven't had luck with it. Would anyone help me get it straight? My test.php document looks as simple as this:
$xml = simplexml_load_string( file_get_contents( 'http://api.autoit.dk/car/GetCarsExtended/391B093F-BB4A-45AA-BEFF-7B33842401EA' ) )
or die("Error: Cannot create object");