Print xml with php

后端 未结 4 1203
北荒
北荒 2020-12-22 08:53

I have this php code

    \\n\";
    echo \"\\n\";
    echo \"\\t<         


        
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-22 09:28

    Try viewing your source, the xml is there but just not visible. Your browser will try to show the page as HTML, since you dont supply the correct headers. Since there are no tags, you wont see anything.

    You should send the correct headers, as such:

    header('content-type: text/xml')
    

提交回复
热议问题