map200uk Posted April 30, 2007 Share Posted April 30, 2007 Hi, Finally found a way to solve my lyrics issue, however it involved xml (never used xml with php before) so i looked around about dom/xml and simpleXML simpleXML seems nice enough-as what i want to do is in essence incredibly simple but i am still managing to struggle SimpleXMLElement Object ( [@attributes] => Array ( [id] => 120741 [hid] => VxwOBYpM3iY= [exactMatch] => true ) [title] => Comfort Eagle [feat] => SimpleXMLElement Object ( ) [artist] => SimpleXMLElement Object ( [name] => Cake ) ) s = simplexml_load_file('test.xml'); print_r($s->searchResults->result); I am trying to somehow echoe out the hid attribute...but im not sure how what does '@attributes' mean?! I cant seem tro access the array sorry its such a noob question-i have been reading tutorials. but most cover RSS and other xml stuff unrelated to my issue mark Link to comment https://forums.phpfreaks.com/topic/49292-xml-simplexml-php-i-might-scream/ Share on other sites More sharing options...
map200uk Posted April 30, 2007 Author Share Posted April 30, 2007 someone must know:! Link to comment https://forums.phpfreaks.com/topic/49292-xml-simplexml-php-i-might-scream/#findComment-241520 Share on other sites More sharing options...
Nameless12 Posted April 30, 2007 Share Posted April 30, 2007 the @attributes is the attributes of the element. Php can access an object as if it was an array and that is what simplexml can do if you use the array operators on simplexml objects you will access the attribs it can also be used for selecting children in certain instances. Link to comment https://forums.phpfreaks.com/topic/49292-xml-simplexml-php-i-might-scream/#findComment-241550 Share on other sites More sharing options...
map200uk Posted April 30, 2007 Author Share Posted April 30, 2007 im a bit confused as to how you mean i can acess it mate? Link to comment https://forums.phpfreaks.com/topic/49292-xml-simplexml-php-i-might-scream/#findComment-241558 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.