I have this php code
\\n\";
echo \"\\n\";
echo \"\\t<
you have to put header (to let the browser know how to render the display):
header ("Content-Type:text/xml");
You have to use proper content-type, as the others have said. I recommend you to use XMLReader. Or if you want a n easier way, then try to use Heredoc string syntax with sprintf and htmlspecialchars to encode values with characters that have special meanings in XML (like <>&)
Try viewing your source, the xml is there but just not visible. Your browser will try to show the page as HTML, since you dont supply the correct headers. Since there are no tags, you wont see anything.
You should send the correct headers, as such:
header('content-type: text/xml')
As the others have said, you need to give the browser a header to let it know how to display the page.
As for xml functions, have a look at the PHP SimpleXMLElement