echo XML values
- by danit
Here is my XML:
object(SimpleXMLElement)#1 (2) {
["@attributes"]=>
array(1) {
["type"]=>
string(5) "array"
}
["feed"]=>
array(3) {
[0]=>
object(SimpleXMLElement)#2 (6) {
["title"]=>
string(34) "Twitter / Favorites from bob"
["id"]=>
string(27) "tag:twitter.com,2007:Status"
["link"]=>
array(2) {
[0]=>
object(SimpleXMLElement)#5 (1) {
["@attributes"]=>
array(3) {
["type"]=>
string(9) "text/html"
["href"]=>
string(38) "http://twitter.com/bob/favorites"
["rel"]=>
string(9) "alternate"
}
}
[1]=>
object(SimpleXMLElement)#6 (1) {
["@attributes"]=>
array(3) {
["type"]=>
string(20) "application/atom+xml"
["href"]=>
string(40) "http://twitter.com/favorites.atom?page=1"
["rel"]=>
string(4) "self"
}
}
}
["updated"]=>
string(25) "2010-04-01T10:44:19+00:00"
["subtitle"]=>
string(56) "Twitter updates favorited by Dan Humpherson / MoodleDan."
["entry"]=>
array(20) {
[0]=>
object(SimpleXMLElement)#7 (7) {
["title"]=>
string(104) "smashingmag: Sikuli: a visual technology to search and automate GUIs using images - http://bit.ly/6ArwzP"
["content"]=>
string(104) "smashingmag: Sikuli: a visual technology to search and automate GUIs using images - http://bit.ly/6ArwzP"
["id"]=>
string(72) "tag:twitter.com,2007:http://twitter.com/smashingmag/statuses/11389386545"
["published"]=>
string(25) "2010-03-31T22:06:41+00:00"
["updated"]=>
string(25) "2010-03-31T22:06:41+00:00"
["link"]=>
array(2) {
[0]=>
object(SimpleXMLElement)#27 (1) {
["@attributes"]=>
array(3) {
["type"]=>
string(9) "text/html"
["href"]=>
string(51) "http://twitter.com/smashingmag/statuses/11389386545"
["rel"]=>
string(9) "alternate"
}
}
[1]=>
object(SimpleXMLElement)#28 (1) {
["@attributes"]=>
array(3) {
["type"]=>
string(10) "image/jpeg"
["href"]=>
string(64) "http://a3.twimg.com/profile_images/572829723/original_normal.jpg"
["rel"]=>
string(5) "image"
}
}
}
["author"]=>
object(SimpleXMLElement)#29 (2) {
["name"]=>
string(17) "Smashing Magazine"
["uri"]=>
string(31) "http://www.smashingmagazine.com"
}
}
For the life of me I cannot get my code to work, all I want to do is echo the entry->content string but no matter what I try I get nothing.
Can anyone assist an inept PHP n00b?