graham23s Posted December 1, 2009 Share Posted December 1, 2009 Hi Guys, I use the following code to save to my pc, the xml data from a feed: <?php $request->asXML("data.xml"); $response = simplexml_load_file("data.xml"); ?> This works perfectly, when i view the contents of the saved xml i see: <?xml version="1.0"?> <root><bonus><bonus bonus_id="5" qty="4" title="titleName" variant="6"/><bonus bonus_id="6" qty="2" title="titleName2"/></bonus><category name="Acne Care"><product bestseller_flag="0" brand="clearasil" brand_flag="0" container="tablet" generic="yes" name="titleName3"><description> The structure of this xml is different from what i am used to lol, what would be the best way to grab all the values of each name? something=value, something=value never really done this type before. thanks for any help guys Graham Link to comment https://forums.phpfreaks.com/topic/183635-getting-xml-data/ Share on other sites More sharing options...
cags Posted December 2, 2009 Share Posted December 2, 2009 They are called attributes, check the link for how simplexml handles them. Link to comment https://forums.phpfreaks.com/topic/183635-getting-xml-data/#findComment-969679 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.