Im using simplexml to bring in a data feed, and now i want to put that into working varables to use in my php doc.
Following the php.net guides on simplexml ive arrived at
<?php
$xml = simplexml_load_file('f1_feed.xml');
$xml = new SimpleXMLElement($xmlstr);
echo $xml->response->williamhill->class->type->market[0]->name;
?>
but i keep getting a blank page, have i completely missed to point of how to parse the xml and put it into a working var ?
(feed is local for development)
you don’t need both
new SimpleXMLElementandsimplexml_load_file:simplexml_load_fileReturns an object of class SimpleXMLElementSimpleXMLElementReturns a SimpleXMLElement objecttry:
or:
if it still doesn’t work, add
for better error reporting