Re: view xml thru php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Joakim Ling wrote:

Hi,

Im trying to view a xml file (texttv.xml) thru php.


Are you wanting to see the raw xml? You can do it like so:

<?php

$file = './path/to/file.xml';
header("Location: $file");

?>

Or, are you wanting to have the xml as part of the php script's output? Then you might do this:

<?php

$file = './path/to/file.xml';
$xml = file_get_contents($file);
echo '<pre>';
echo htmlentities($xml);

?>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux