开发者

simplexml_load_string: how to get openSearch:itemsPerPage in youtube's video feed?

using simplexml_load_strin开发者_开发百科g how to get openSearch:itemsPerPage value from a feed in this format:

http://code.google.com/apis/youtube/2.0/developers_guide_protocol_understanding_video_feeds.html


In SimpleXML you can use the children('prefix', true) and attributes('prefix', true) functions to access namespaced content.

$xml = simplexml_load_string($string);
$itemsPerPage = (string)$xml->children('opensearch', true)->itemsPerPage;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜