When not to close a php file?

前端 未结 3 2004
南笙
南笙 2021-01-11 21:11

I\'ve come across a tutorial (reputable one if I may add) where the closing php tag ?> was omitted. This reminded me of a previous tutorial where the author

3条回答
  •  长发绾君心
    2021-01-11 22:05

    In addition to the other great answers, I'd like to note that this practice is mainly used in files that contain only PHP code.

    I always close the last tag while editing templates/views, so I don't have to when I add other content below that point.

提交回复
热议问题