title: Why does this header location redirect work after content has already been echoed?
body: <pre><code>&lt;?
  echo "lalala";
  header("Location: http://www.google.com/");
  </code></pre>
  
  <p>If i put this in a plain php file and deliver over a standard apache2 server with mod-php (PHP Version 5.3.2-1ubuntu4.10) the redirect to google works.</p>
  
  <pre><code>&lt;?
  echo "lalala";
  flush();
  header("Location: http://www.google.com/");
  </code></pre>
  
  <p>this code does obviously not produce a working redirect.</p>
  
  <p>My question is how the first code is beeing processed and why it works. Because I remember times when things like this were not possible. Is mod-php or apache intelligent enough to buffer the whole request and arrange headers before content? </p>
  
  <p>And:</p>
  
  <p>Can I rely on this if I make sure I don't flush the output manually? Because it would make my application much easier...</p>