/    Sign up×
Community /Pin to ProfileBookmark

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):

[code]
<playing>
<artist>[b]Cindy[/b]</artist>
<song>[b]echo[/b]</song>
<image>[b]http://www.somesite.com/song_images/cindy.jpg[/b]</image>
<rating>3.5</rating>
<songid>4736</songid>
</playing>

[/code]

php code that uses retrevied data:

[code]
<?
$imageurl = “http://www.somesite.com/song_images/cindy.jpg”;
$artist = “cindy”;
$song = “echo”;
…..
…..

?>
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 21.2007 — If you're using PHP5, you should take a look at the [url=http://www.php.net/simpleXML]SimpleXML functions[/url].
×

Success!

Help @method spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...