title: Prevent 'headers already sent'
body: <p>When you try to redirect an user with Header:Location to another page when there is already 'output' on the page, PHP will display the message: headers already sent.</p>
  
  <p>Is it a good solution to create a function, and call that function wherever you need it (even at the bottom of the page)?</p>
  
  <p>Thanks!</p>
  
  <p>Example:</p>
  
  <pre><code>function redirectMe($location){
      header('Location:'.$location);
  }
  
  //HTML
  
  //Redirect user:
  redirectMe('http://www.google.com');
  </code></pre>