title: header location not redirecting at once, looking for alternative
body: <p>I was writing a script where I have a redirect header in the end.</p>
  
  <p>Then I added a redirect header in the middle if a specific condition would come up.</p>
  
  <p>I was very surprised to notice that the last header("Location:http//mydomain.com") was the one that triggered. I thought that the header would automatically "jump" from the page, but it seems like it just keeps it in memory and goes through the whole page first.</p>
  
  <p>Any ideas on what the "proper" way to "cut" the flow and change page is?</p>
  
  <pre><code>&lt;?php
  $specific_condition=true;
  // I wanted this to be the end
  if($specific_condition) header("Location: http://google.com/"); 
  // But it still triggers following redirect
  header("Location: http://bing.com/");
  ?&gt;
  </code></pre>