Verkar inte som att jag kan öppna/parsa något externt xml-dokument alls. :(
Har detta:
<?php
error_reporting(E_ALL);
ini_set("display_errors",true);
if (file_exists("http://fof.se/pod/rss.xml")) {
$xml = simplexml_load_file("http://fof.se/pod/rss.xml");
print_r($xml);
} else {
exit('Failed to open the XML document.');
}
?>
Får bara "Failed to open the XML document." hela tiden.
try {
$xml = new SimpleXMLElement('http://fof.se/pod/rss.xml', NULL, TRUE);
} catch (Exception $e) {
echo 'Ojsan, kan ej ladda xml: ', $e->getMessage();
}
if (NULL !== $xml) {
// gör något kul med xml-trädet
}
try {
$xml = new SimpleXMLElement('http://fof.se/pod/rss.xml', NULL, TRUE);
} catch (Exception $e) {
echo 'Ojsan, kan ej ladda xml: ', $e->getMessage();
}
if (NULL !== $xml) {
// gör något kul med xml-trädet
}
Då fick jag:
Fatal error: Cannot clone object of class SimpleXMLElement due to 'zend.ze1_compatibility_mode' in bla, bla, bla...