how can I write xml in browser?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
saumya
Forum Contributor
Posts: 193
Joined: Sun Jan 30, 2005 10:21 pm

how can I write xml in browser?

Post by saumya »

I have tried all but no success.
echo();
HERE doc

but no luck
I just want to print
<XML>
<name>sam</name>
<phone>100</phone>
</xml>

Please help
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Want help? Post code.
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Post by toasty2 »

Are you meaning, being able to put stuff between < and > without it being parsed? < or > is for actually displaying the less than or greater than sign. You question is unclear, please expand.

Edit: Are you telling it what to echo()? Try

Code: Select all

echo "stuff";
and replace stuff with what you want to output.
Last edited by toasty2 on Mon Sep 04, 2006 1:40 pm, edited 1 time in total.
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

Code: Select all

header( 'Content-Type: text/xml' );
saumya
Forum Contributor
Posts: 193
Joined: Sun Jan 30, 2005 10:21 pm

Post by saumya »

thank you Todd_Z,
it worked.
Thank you so much.
Post Reply