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