<?php
$feed = file_get_contents('http://thexmofo.wordpress.com/feed/');
$xml = new SimpleXMLElement($feed);
$xml->registerXPathNamespace('media', 'http://thexmofo.wordpress.com/feed/');
$images = $xml->xpath('/rss/channel/item/media:[email protected]');
var_dump($images);
?>
谁能告诉我为什么我得到Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Invalid expression
其次bool(false)
?的XPath表达式无效
Josh你猜对了...因为我已经做出了像我非常接近的尝试......正确的东西,所以我没有这么随机。谢谢。 – jay