note 77700 modified in ref.xml by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Mar 2010 18:55:36 +0000 |
| Subject: | note 77700 modified in ref.xml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-166622@lists.php.net to get a copy of this message | ||
The problem I had was I needed to generate xml on the screen for users to actually see and copy to a
file.
I'm generating the xml manually from a php file and the browser kept interpreting the xml...not
very helpful.
This is how you get around it:
<?php
$file = file_get_contents("http://example.com/xml.php?whatever=$whatever");
print nl2br(htmlentities($file));
?>
Prints all my xml quite nicely.
--was--
The problem I had was I needed to generate xml on the screen for users to actually see and copy to a
file.
I'm generating the xml manually from a php file and the browser kept interpreting the xml...not
very helpful.
This is how you get around it:
<?
$file = file_get_contents("http://fileurl/xml.php?whatever=$whatever");
print nl2br(htmlentities($file));
?>
Prints all my xml quite nicely.
http://php.net/manual/en/ref.xml.php