如何在PHP中输出?

时间:2011-03-27 05:44:24

标签: php xml

    SimpleXMLElement Object
 (
    [@attributes] => Array
    (
        [version] => 2.0
    )

   [channel] => SimpleXMLElement Object
    (
        [title] => idcspy
        [link] => http://idcspy.com
        [description] => SimpleXMLElement Object
            (
            )

        [language] => zh-hans
        [item] => Array
            (
                [0] => SimpleXMLElement Object
                    (
                        [title] => hello world.
                        [link] => http://example.com/node/48
                        [description] => ....

现在,我想回应你好世界和链接值。如何输出它。当我使用它时:echo $doc->channel->item[0]['title'];没有任何结果。

1 个答案:

答案 0 :(得分:0)

echo $doc->channel->item[0]->title;