开发者

PHP: foreach warnings on simplexml

PHP and XML question:

Here is the var_dump i get from parsed xml.

object(SimpleXMLElement)#47 (6) {
    ["link"]=> array(4) {
        ...
    }
    ["entry"]=> array(11) {
        ...
    }
}

However, when I use:

foreach ($parsedReturn->link as $item)

or,

foreach ($parsedReturn->entry as $item)

I get warnings as such:

PHP Warning: Invalid argument suppl开发者_开发技巧ied for foreach()


The "link" could be attribute, so you would have to use $parsedReturn['link'].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜