我试图冲洗XML的分子。 实际上,出现了错误:
Catchable fatal error: Object of class DOMElement could not be converted to string in ...
I want to get the value "test" of the tag "link"
我的法典如下:
//check if url contents xml
$content = file_get_contents($flux);
$xml = new DOMDocument;
$xml->loadXML($content);
//get the link
$link = $xml->getElementsByTagName( link )->item(0);
echo $link;
这里是流体:
<?xml version="1.0" encoding="ISO-8859-15" ?>
<rss version="2.0">
<channel>
<title>test</title>
<link>http://test.fr</link>
</channel>
</rss>
谁能帮助我?