XML rss 플럭스를 구문 분석하려고합니다. 사실, 오류가 발생합니다 : 여기 클래스 DOMElement의 객체를 문자열로 변환 할 수 없습니다.
//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;
는 플럭스 :
Catchable fatal error: Object of class DOMElement could not be converted to string in ...
내가 태그 "링크"여기
의 값 "테스트"를 얻으려면 내 코드입니다 :
<?xml version="1.0" encoding="ISO-8859-15" ?>
<rss version="2.0">
<channel>
<title>test</title>
<link>http://test.fr</link>
</channel>
</rss>
누구나 나를 도와 줄 수 있습니까?
가능한 도움 : http://stackoverflow.com/questions/548744/php-xpath-question – diEcho