我使用cURL從XML源提取數據。我需要從XML中獲得特定的值。從cURL獲取價值XML
我需要的文字:Gymnázium克里斯蒂娜Dopplera(<D:Nazev>
)
我使用DOMDocument
試過,但我得到一個 「嚴重錯誤」。
我在做什麼錯?
if ($curl = curl_init("http://wwwinfo.mfcr.cz/cgi-bin/ares/darv_sko.cgi?ico=61385701")) {
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($curl);
curl_close($curl);
}
$dom = new DOMDocument();
$dom = loadXML($content);
echo $dom->getElementsByTagName("Nazev");
Fatal error: Call to undefined function loadXML() in C:\www\pokusy\ares\index.php on line 13
你試過[DOM文檔(http://php.net/manual/en/class.domdocument.php )? [preg_match_all](http://php.net/manual/en/function.preg-match-all.php)?告訴我們你已經嘗試過了。 – uri2x
我試過DOMDocument,但它不正確。 http://paste.ofcode.org/AUdrbdnGAAxgWEy4xpqx3C。錯誤:**致命錯誤:調用未定義的函數loadXML()在C:\ www \ pokusy \ ares \ index.php在第13行** – BlaBlaBla
請添加您嘗試過的問題本身,而不是評論,以便其他人更多很可能會看到它並用它來幫助回答你的問題。 – JeffC