Re: To ?> or not to ?>
| From: | Donovan Brooke | Date: | Wed, 04 Apr 2012 03:39:54 +0000 |
| Subject: | Re: To ?> or not to ?> | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317446@lists.php.net to get a copy of this message | ||
Stuart Dallas wrote:
[snip]
Usually when setting headers after such a script has been included when output buffering is turned off. Personally I never put the closing ?> in if it's at the end of the file because it's unnecessary and can cause issues if it's present, but it's personal preference more than anything else. Ultimately you have to consider that there's a reason it's optional - things like that don't generally happen by accident. I remember Rasmus commenting on this style issue a few years back so a search of the archives should find an "official" position. -StuartCould using ob_start and ob_end_flush eliminate the ambiguity of whether or not to use '?>'? Donovan -- D Brooke