Why would one omit the close tag?

前端 未结 14 1561
旧巷少年郎
旧巷少年郎 2020-11-21 06:18

I keep reading it is poor practice to use the PHP close tag ?> at the end of the file. The header problem seems irrelevant in the following context (and this

14条回答
  •  南笙
    南笙 (楼主)
    2020-11-21 07:19

    It isn't a tag…

    But if you have it, you risk having white space after it.

    If you then use it as an include at the top of a document, you could end up inserting white space (i.e. content) before you attempt to send HTTP headers … which isn't allowed.

提交回复
热议问题