View Full Version : How to Write Out to XML?

05-02-2006, 07:36 PM
Is it possible to write this following information from a php page to an XML page

<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="1.0"> <channel>

<title> i-cast: Action Adventure </title>

where the tags and characters have to be included and also in the format that it is in??

05-02-2006, 08:45 PM
you will need to set the header first

header('Content-type: text/xml');

and you have to print out this part of XML like so otherwise it will result in a parse error (note how it uses the <? and ?> which are used by PHP):

print '<?xml version="1.0" encoding="iso-8859-1"?>';