Extra content at the end of the document PHP and XML

前端 未结 3 1260
旧巷少年郎
旧巷少年郎 2020-12-04 02:18

I having a strange problem when I\'m trying to produce an XML file with PHP. The problems is that, a strange question mark appears at the end of the source code. And I get t

相关标签:
3条回答
  • 2020-12-04 03:12

    You have a zero width space character at the end of your file - UTF-8 code E2 80 8B. It is placed right after </Module>. Have a look at your file in hex mode. This extra character prevents your browser from recognizing this as valid XML and - depending on the browser in use - shows up as a question mark or does not show up at all.

    Remove that extra character and you will be fine.

    0 讨论(0)
  • 2020-12-04 03:14

    May be you use UTF-8 with BOM encoding. Check it

    0 讨论(0)
  • 2020-12-04 03:17

    I don't really have answer, accept that my editor wasn't showing the question mark. But one I opened the file in notepad2, lo and behold, the question mark was there. Very strange. Thanks for your help.

    0 讨论(0)
提交回复
热议问题