2012-10-05 111 views
-2

我有这样一个SimpleXMLElement:打印SimpleXMLElement对象

SimpleXMLElement Object ([trailer] => SimpleXMLElement Object (
[title] => This is the title 
[link] => http://example.com 
[trailer_id] => 60373 
[embed] => SimpleXMLElement Object ())) 

我现在一个谷歌两小时,也找不到如何打印的“trailer_id”。 有人能指出我正确的方向吗?

+1

有趣,你用什么样的文本,而搜索这一点。 – Leri

+0

你介意发布原始XML吗? –

+0

两个小时? ':○)'。刚刚找到[this](http://stackoverflow.com/questions/1133931/getting-actual-value-from-php-simplexml-node),看起来非常有帮助。 – halfer

回答

1

他们都是对象,尝试:

echo $xml->trailer->trailer_id; 
+0

谢谢,工作像魅力。 – 3und80