The PHP simplexml_load_string() function is used to read XML data from a string. The example below shows how to use the simplexml_load_string() function. If you just want a plain-text representation of your (pre-formatted) string, you can wrap it in HTML tags and use htmlentities to escape the angle brackets. In this tutorial, I will show you How to display XML content with php using header content adopteesofcolor.org header informs the browser which type of document it is so the. Description ¶. public SimpleXMLElement::asXML ([ string $filename ]): mixed. The asXML method formats the parent object's data in XML version You can use that in a regular HTML document or use it as a widget to display a .. I'm much interested in how to generate xml from php data structure.i.e. array. Many examples in this reference require an XML string. Instead of repeating this string in . This example shows how one might change a DOM element to SimpleXML. php $dom = new ie dot raymond at gmail dot com ¶. 9 years ago. As the title says I can do this with ASP but not sure how to code this for php? I' m not using flash, I just want to know how to use php to display xml from another site. 0 Likes grab URL and pass it to the browser. curl_exec($ch);. output in Browser? 2 Replies. To display XML file on browser use this header. PHP Share. This entry was posted in PHP-XML on August 28, by om. XML Document Example; How to Read XML using PHP; How to the employees XML document and display the results in a web browser.