I have a PHP file which echoes an XML output. However, whenever I go to view that PHP file through Firefox (I haven't tried IE or Chrome), I get a raw text output like seen in this image:
It seems to me that, since the file is a PHP file, Firefox interprets it as such and does not try to display it as an XML tree, despite its XML heading. I am aware that one solution would be to send the output to a separate file with a .xml extension, but I know there must be an easier way. I guess what I am really trying to find out is how to get Firefox to recognize the XML format and display it as it should. Any help is greatly appreciated.
Tell the browser you are sending it an XML file: