title: Php 404 Not Found Header
body: <p>I am trying to understand the combination of 3 simple php code lines,
  This is the code:</p>
  
  <pre><code>ob_end_clean();
  header('HTTP/1.0 404 Not Found');
  exit;
  </code></pre>
  
  <p>So this is the code and as i understand the first line <strong>ob_end_clean();</strong>, Can help for example with <strong>BOM(Byte order mark)</strong>, So the first line is to prevent any previous output.</p>
  
  <p>The second line <strong>header('HTTP/1.0 404 Not Found');</strong> is the header.</p>
  
  <p>And the third line <strong>exit</strong> terminates the script execution.</p>
  
  <p>If i remove the first line and i got a <strong>BOM</strong> at the document i get blank page (No 404).</p>
  
  <p>If i remove the third line (<strong>with and without the BOM</strong>), I get the page i wanted no blank page and no 404.</p>
  
  <ul>
  <li>Mabye if anyone can explain why should i use the <strong>exit</strong> After the
  404 header</li>
  <li>Also why with the <strong>BOM</strong> i dont get "headers already sent error"</li>
  </ul>
  
  <p>Thank you all and have a nice day.</p>