Error on line 2 at column 1: Extra content at the end of the document

前端 未结 4 1664
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 11:03

When I use the below code and parse the xml locally it works fine but when upload the same script at the server it shows error.

Note: I retrieved the $lng

4条回答
  •  独厮守ぢ
    2020-12-10 11:31

    You might have output (maybe error/debug output) that precedes your call to

    header("Content-type: text/xml");
    

    Therefore, the content being delivered to the browser is not "xml"... that's what the error message is trying to tell you (at least that was the case for me and I had the same error message as you've described).

提交回复
热议问题