Tuesday, 10 September 2013

Echo JSON/XML in PHP

Echo JSON/XML in PHP

I'm using the last.fm API to get a user's recent tracks and it returns
either a JSON string or an XML document.
XML:
http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=rj&limit=5&api_key=cf9021419b97b1e4611d580e6304e5be
JSON:
http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=rj&limit=5&api_key=cf9021419b97b1e4611d580e6304e5be&format=json
Which should I use? and I want to get the track names to echo using PHP,
how should I do this?
Thanks a lot!

No comments:

Post a Comment