how to print the xml file?

Discussion in 'PHP' started by vetrivel, Dec 1, 2009.

  1. #1
    Hi,
    I have a xml content and i need to print it with the xml tags?
    How to do it?

    EX:
    <start>
    <one>
    this is one
    </one>
    </start>

    When i put it in the print_r it only displays the content "this is one" ,but i need to print it with the tags.
     
    vetrivel, Dec 1, 2009 IP
  2. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #2
    You need to add the header so that the browsers know what type of content you want to send

    header ("content-type: text/xml");
    print($content);
    PHP:
    Should work better
     
    n3r0x, Dec 1, 2009 IP
  3. vetrivel

    vetrivel Peon

    Messages:
    147
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hoo.thanks

     
    vetrivel, Dec 1, 2009 IP