I want to write a php script "test.php" that outputs the contents of a "sample.xml" file (with appropriate Content-Type: xml) just as if a user went directly to the "sample.xml". How do I accomplish this? Is there some framework needed?
1 Answer
no framework needed... just a little work with header, here is an example:
test.php:
<?php
header("Content-Type:text/xml");
echo file_get_contents('sample.xml');
?>