This is my problem. I'm trying to get a value from the XML url (from last.fm api) Example For, the biography of an artist
I already know that I can do this just like (for Adele):
This return:
Adele Laurie Blue Adkins, (born on May 5, 1988) is a Grammy Award-winning English & lt; A href = "http: //www.last.fm/tag/singer-songwriter" class = "bbcode_tag" rel = "tag" & gt; Singer-songwriter & lt; / A & gt; Enfield, its first album from North London, & lt; A title = "Adele-19" href = "http://www.last.fm/music/Adele/19" class = "bbcode_album" & gt; 19 & lt; / A>, was released in January 2008 and entered the UK Albums Chart # 1. This album has received platinum authentication four times in the UK and has sold 5,500,000 copies worldwide. The album included a hugely popular song & lt; A title = "Following Adele & pavements" href = "http://www.last.fm/music/Adele/_/Chasing+Pavements" class = "bbcode_track" & gt; Chasing down & lt; / A & gt; Edelley earned two Grammy Awards in February 2009 for Best New Artist and Best Female Pop Vocal Performance. Now I would like to keep that result in a text file and store it in a folder on my website, for example: "http://mysite.com/artistdescriptions/adele Txt ".
I've already tried:
& lt ;? Php $ file_path = $ _SERVER ['DOCUMENT_ROOT']. '/ Artist name / adele.txt'; $ Xml = Simple XMLload_file ("http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=adele&ipi_key=b25b959554ed76058ac220b7b2e0a026"); $ Info = $ xml- & gt; Artist- & gt; Bio- & gt; Summary; File_put_contents ($ file_path, $ info); $ File_contents = file_get_contents ($ file_path); If (! $ File_contents)! {$ Data = unserialize ($ file_contents); $ Data echo; }? & Gt; But it did not work unfortunately. Any help will be very much appreciated!
"post-text" itemprop = "text"> The echo call magic method __toString (), but is not serial, and the sequential permission is not allowed in the simple expression, so it is to throw exceptions.
$ info = $ xml- & gt; Artist- & gt; Bio & gt; Summary-> __ toString ();
Comments
Post a Comment