Why do some scripts omit the closing PHP tag, ‘?>’? [duplicate]

Well, omitting the closing tag is just one solution for avoiding blanks and other characters at the end of file. For example any char which is accidentally added behind the closing tag would trigger an error when trying to modify header info later.

Removing the closing tag is kind of “good practice” referring to many coding guidelines.

Leave a Comment