NYCPHP Meetup

NYPHP.org

[nycphp-talk] Closing Tags or Not Closing Tags, that is my question...

John Campbell jcampbell1 at gmail.com
Tue Dec 18 13:12:05 EST 2007


I was browsing the MediaWiki repository (the code behind wikipedia)
one day and I saw that someone removed all of the closing tags.  I
immediately thought it was smart and did the same thing to my code.
Excluding the closing tag at the end of the file is a *good idea*.
Are there any "sed" gurus on the list that can write a 1 liner to
remove the closing tags?

David,

This does not apply to files that mix php and html.  This is for php
only files, such as classes, or config files.   If your application
separates the presentation logic from the application logic, you will
have lots of files that are pure php and this prevents those scripts
from inadvertently sending output to the browser.

Regards,
John Campbell



More information about the talk mailing list