Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Write Out to XML?

    Is it possible to write this following information from a php page to an XML page

    Code:
    <?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??

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you will need to set the header first
    PHP Code:
    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):
    PHP Code:
    print '<?xml version="1.0" encoding="iso-8859-1"?>';


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •