By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,932 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

how to make call xml file in php runtime

P: 1
hi, how to create a XML file in php and run time on a browser php generate this XML file. i cannot understand how i perform it please guide me.thanks in advance.
Dec 8 '11 #1
Share this Question
Share on Google+
1 Reply


AutumnsDecay
100+
P: 170
What are you trying to use this XML for? Are you trying to take information from a user and store it in a new XML page, or do you simply need PHP to render as an XML file on the fly?

If you want PHP to render information as XML at run time, you can do something like:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. header('Content-type: application/xml');
  3. print "<root>";
  4. print "\t <parent>";
  5. print "\t\t <child>Value</child>";
  6. print "\t </parent>";
  7. print "</root>";
  8.  
  9. ?>
  10.  
You can use PHP + MySQL or Form variables to compile the XML sheet as you need.
Dec 8 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.