tony007
02-20-2007, 02:45 PM
How to referene perticuler xml data in php?
Hi all. i have an xml file as shown below and i want to reference specific data out it.(The data shown in bold)Could any one show me how to reference those data so i can use them later as variables.I not only want to output them all at once.I also want to learn how to reference individual items separately because i have another part that uses those 3 variables(Artistname,songname,songimage).i be happy if some show me how this can be done in php.Thanks
xml file(rss feed with one set of data always):
<playing>
<artist>Cindy</artist>
<song>echo</song>
<image>http://www.somesite.com/song_images/cindy.jpg</image>
<rating>3.5</rating>
<songid>4736</songid>
</playing>
php code that uses retrevied data:
<?
$imageurl = "http://www.somesite.com/song_images/cindy.jpg";
$artist = "cindy";
$song = "echo";
.....
.....
?>
Hi all. i have an xml file as shown below and i want to reference specific data out it.(The data shown in bold)Could any one show me how to reference those data so i can use them later as variables.I not only want to output them all at once.I also want to learn how to reference individual items separately because i have another part that uses those 3 variables(Artistname,songname,songimage).i be happy if some show me how this can be done in php.Thanks
xml file(rss feed with one set of data always):
<playing>
<artist>Cindy</artist>
<song>echo</song>
<image>http://www.somesite.com/song_images/cindy.jpg</image>
<rating>3.5</rating>
<songid>4736</songid>
</playing>
php code that uses retrevied data:
<?
$imageurl = "http://www.somesite.com/song_images/cindy.jpg";
$artist = "cindy";
$song = "echo";
.....
.....
?>