title: How do headers work with output buffering in PHP?
body: <p>Title is self-explanatory.</p>
  
  <p>I have a good bit of experience with PHP, but I am not sure how the <code>header</code> function works between <code>ob_start()</code> and <code>ob_end_clean()</code>.</p>
  
  <p>Consider this:</p>
  
  <pre><code>ob_start();
  
  echo "Some content";
  header('X-Example-Header: foo');
  echo "Some more content";
  
  $output = ob_get_contents();
  ob_end_clean();
  
  echo $output;
  </code></pre>
  
  <p>Does the <code>header</code> function ignore the output buffering, and thus all headers get sent before the content because it is <code>echo</code>ed after the <code>header</code> call?</p>
  
  <p>Or does it work some other way?</p>