PDA

View Full Version : need help pulling out certain info from an xml file please


LJackson
10-06-2009, 04:08 PM
Hi All

i am trying to pullout each of the tracks from this xml file.
[Item] => SimpleXMLElement Object ( [ASIN] => B002NX0M1Y [Tracks] => SimpleXMLElement Object ( [Disc] => SimpleXMLElement Object ( [@attributes] => Array ( [Number] => 1 ) [Track] => Array ( [0] => 3 Words - Cheryl Cole, will.i.am [1] => Parachute [2] => Heaven - Cheryl Cole, will.i.am [3] => Fight For This Love [4] => Rain On Me [5] => Make Me Cry [6] => Happy Hour [7] => Stand Up [8] => Don't Talk About This Love [9] => Boy Like You - Cheryl Cole, will.i.am [10] => Heartbreaker - will.i.am, Cheryl Cole ) ) ) ) ) )

the above is a snippet of an xml file i have tried this code
foreach($items->Tracks->Track as $track){
print $tracks;
}?>


but it isnt printing out the tracks? anyone have any ideas

thanks
Luke

abduraooft
10-06-2009, 04:34 PM
foreach($items->Tracks->Track as $track){
print $tracks;
} Isn't that obvious?

LJackson
10-06-2009, 04:45 PM
ah silly type! have been changing the code around so much lol but it still doesnt display anything :(

thanks
Luke