开发者

SimpleXML not loading all fields

开发者 https://www.devze.com 2023-02-05 21:05 出处:网络
For some reason my SimpleXML implementation is not grabbing all the data: $feed = simplexml_load_file(\'http开发者_Python百科://www.example.com/feed\');

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

精彩评论

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