Re: create xml document with PHP
| From: | J Smith | Date: | Tue, 29 Jan 2002 16:48:43 +0000 |
| Subject: | Re: create xml document with PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-82573@lists.php.net to get a copy of this message | ||
The only real difference between HTML and XML (besides the obvious
standards and formats and such) is the MIME type, I believe. HTML has a
"text/html" MIME type, while XML can have a whole bunch, depending on what
the XML is supposed to do. (I.e. text/xml, application/xml,
application/xml-dtd, etc.)
Try outputing the XML using "text/xml" as the MIME type by using
header("Content-type: text/xml");
at the beginning of your script. (Or at least as the first bit of output --
nothing should come before the headers.
J
Rodrigo Peres wrote:
> Hi list,
>
> I'm new to the xml world, and I need to create a page with data retrieved
> from my database using PHP. The process is the same of create an html
> page?? I mean I can use echo to output the xml tags and values?? Since
> this page will be dinamically generated what kind of headers I need to use
> to this page become an xml???
> I saw many docs in web but all about parse an xml, but not in how to build
> one.