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']
.
精彩评论