How to display the result of reading an XML file correctly

Asked

Viewed 34 times

1

Good morning ,

I came up with the need to read an XML file available in a URL, however , even following the questions already opened here in the stack as :Query the XML URL the data are returned to me without any information and I have assurance that there is content in this URL.

When I use this reading system:

      <?php
        $xml =simplexml_load_file('https://www.meusite.com.br/X/teste.xml');
      echo "<pre>"; 
      print_r($xml);
      echo "</pre>";   
      ?> 

Me is returned to structure without any data:

inserir a descrição da imagem aqui

What mistake am I making in displaying this file?

  • 1

    Blz , I edited the question and now it raises the real question , I formatted with <pre>and was actually formatted in conventional format however not displayed any content.

  • The xml may be with syntax error, see here here to check syntax error in xml at loading time.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.