How to display xml response already formatted in html (IE won't show anything after the xml table)

How to display xml response already formatted in html (IE won't show anything after the xml table)

If you go to this page in IE, you will see that nothing appears after the graph: http://www.ratecatcher.com/prototype.htm

Here is the main php code:

$ xml = file_get_contents ($ request); echo html_entity_decode ($ xml);

Then the html that is giving me problems:

the user in IE won't see anything after that.

Is there a better way to render html than html_entity_decode? I've heard about simplexml but don't know if it works with html.

Thanks for the help!

0


a source to share


1 answer


You can try using DOMDocument.



$dom = new DOMDocument('1.0', 'utf-8');
$dom->loadXML(file_get_contents($request));

echo $dom->saveXML(); // or saveHTML()

      

+1


a source







All Articles