-2

我有一个这样的 SimpleXMLElement:

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

我已经用谷歌搜索了两个小时,但找不到如何打印 "trailer_id"。有人能指出我正确的方向吗?

4

1 回答 1

1

它们是对象,请尝试:

echo $xml->trailer->trailer_id;
于 2012-10-05T13:42:39.097 回答