开发者

SimpleXML not loading all fields

For some reason my SimpleXML implementation is not grabbing all the data:

$feed = simplexml_load_file('http开发者_Python百科://www.example.com/feed');
print_r($feed);

#This leaves out <media:thumbnail> and <dc:creator>

What's going on?

Thanks for your help.


You need to use the children method, specifying the namespace. The default access and iteration methods only operate on the default namespace.

See here for an example.

EDIT: Broken link above, see here for the last version available from Wayback.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜