我使用php DOMDocument来解析RSS2.0提要。除了这条线外,一切都很顺利。
$image = $node->getElementsByTagName('itunes:image')->item(0)->getAttribute('href');其中$node是<item>元素。
函数之后的$image是空的。
编辑:
以下也是空返回..。
$node->getElementsByTagName('itunes:summary')->item(0)->nodeValue那么,这与节点名称中的:有关吗?
发布于 2013-01-21 23:23:25
了解命名空间,并使用getElementsByTagNameNS。
$node->getElementsByTagNameNS('http://www.itunes.com/dtds/podcast-1.0.dtd', 'summary');https://stackoverflow.com/questions/14448926
复制相似问题