1

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: <![CDATA[ ]]> Maybe that helps.

1

1 Answer 1

6

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

echo $xml->asXML();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.