Connecting Tech Pros Worldwide Help | Site Map

Best way to output xml from php?

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 28th, 2006, 04:55 PM
Brian Lee
Guest
 
Posts: n/a
Default Best way to output xml from php?

I've been googling for a few hours now and I can't seem to find any
tutorials on the best way to generate xml from php... most tutorials
tell you how to pase incoming xml xml. I'm used to using template to
output HTML to the browser but I want to start playing with ajax and
outputting XML to the browser anyone have any suggestions or links to
tutorials?

-Brian


  #2  
Old January 28th, 2006, 05:45 PM
Tim Van Wassenhove
Guest
 
Posts: n/a
Default Re: Best way to output xml from php?

On 2006-01-28, Brian Lee <brianleee@gmail.com> wrote:[color=blue]
> I've been googling for a few hours now and I can't seem to find any
> tutorials on the best way to generate xml from php... most tutorials
> tell you how to pase incoming xml xml. I'm used to using template to
> output HTML to the browser but I want to start playing with ajax and
> outputting XML to the browser anyone have any suggestions or links to
> tutorials?[/color]

Doing it the exact same way as you do now for html seems most
appropriate to me.

--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be>
  #3  
Old January 28th, 2006, 05:55 PM
Carl Vondrick
Guest
 
Posts: n/a
Default Re: Best way to output xml from php?

Brian Lee wrote:[color=blue]
> I've been googling for a few hours now and I can't seem to find any
> tutorials on the best way to generate xml from php... most tutorials
> tell you how to pase incoming xml xml. I'm used to using template to
> output HTML to the browser but I want to start playing with ajax and
> outputting XML to the browser anyone have any suggestions or links to
> tutorials?[/color]

Just do it the same way as you do with HTML.

But, you should always output this FIRST:

<?php
header('Content-Type: text/xml');
print '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
?>
  #4  
Old January 29th, 2006, 01:45 PM
Darkstar 3D
Guest
 
Posts: n/a
Default Re: Best way to output xml from php?

Since your are just getting started, use the DOM. It may seem like more
coding at first, but it well worth it in the long haul. If PHP5,
simpleXML is pretty cool too.

  #5  
Old January 29th, 2006, 06:45 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: Best way to output xml from php?

If you want some examples of creating XML from PHP then take a look at
http://www.tonymarston.co.uk/php-mysql/domxml.html for PHP 4
http://www.tonymarston.co.uk/php-mysql/dom.html for PHP 5

--
Tony Marston

http://www.tonymarston.net



"Brian Lee" <brianleee@gmail.com> wrote in message
news:2006012812482316807-brianleee@gmailcom...[color=blue]
> I've been googling for a few hours now and I can't seem to find any
> tutorials on the best way to generate xml from php... most tutorials tell
> you how to pase incoming xml xml. I'm used to using template to output
> HTML to the browser but I want to start playing with ajax and outputting
> XML to the browser anyone have any suggestions or links to tutorials?
>
> -Brian
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.