Jump to content

getting xml data


graham23s

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.