开发者

simplexml_load_file() returns empty object

开发者 https://www.devze.com 2023-03-21 07:25 出处:网络
I have a url to an xml file and when I visit it in my browser it looks good. With the following script however a lot of information seems to be missing:

I have a url to an xml file and when I visit it in my browser it looks good. With the following script however a lot of information seems to be missing:

<?php

    $xml_url = "example.xml";
    $xml = simplexml_load_file($xml_url);
    print_r($xml);

?>

What's going wrong?

EDIT: when I view the xml file in my browser, the data is shown between these: <开发者_如何学C![CDATA[ ]]> Maybe that helps.


The print() call does not display all information. Do

echo $xml->asXML();
0

精彩评论

暂无评论...
验证码 换一张
取 消