Php

Asked • 05/28/19

Why would one omit the close tag?

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 is the only good argument so far): >Modern versions of PHP set the output_buffering flag in php.ini If output buffering is enabled, you can set HTTP headers and cookies after outputting HTML because the returned code is not sent to the browser immediately. Every good practice book and wiki starts with this 'rule' but nobody offers good reasons. **Is there another good reason to skip the ending PHP tag?**

1 Expert Answer

By:

Volcano T. answered • 05/28/19

Tutor
New to Wyzant

Programming / SysAdmin / DBA

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.