On Sun, 2010-01-10 at 08:52 -0800, Jim Lucas wrote:

> Stuart Dallas wrote:
> > 
> > That's a massive assumption. There are a number of editors that 
> > automatically add a blank line to the end of source files. 
> 
> A single \n after the final ?>  doesn't matter anyways.  Even if the following
> example was two different files where the second included the first, it would
> still have the same results.
> 
> Simple test:
> 
> ########CONTENTS########
> <?php
> 
> ?>
> <?php
> 
> echo (headers_sent() ? 'Yes' : 'No');
> 
> ?>
> ########EOF########
> 
> No, as is, this will return 'No'.  But if you place /ANY/ character between 
> the
> ?>
> <?php
> 
> including a newline, space, tab, etc...  it will send the headers.
> 
> So, basically saying that in this particular case ?><?php === ?>\n<?php
> 
> With all that said, you CAN have a \n at the end of you file directly after 
> the
> ?>.  But, you better make sure that nothing else is there along with it.
> 
> Jim Lucas
> 
> > 
> > -Stuart
> > 
> 


Or if you're using a multibyte encoding in your file which isn't
correctly interpretted...

Thanks,
Ash
http://www.ashleysheridan.co.uk


Reply via email to