title: follow redirects with curl in php
body: <p>I know that using cURL i can see the destination URL, pointing cURL to URL having CURLOPT_FOLLOWLOCATION = true. </p>
  
  <p>Example :</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "www.example1.com");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HEADER, true); 
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); 
  $result = curl_exec($ch);
  $info = curl_getinfo($ch); //Some information on the fetch
  curl_close($ch);
  </code></pre>
  
  <p>$info will have the url of the final destination which can be www.example2.com. 
  I hope my above understanding is correct. Please let me know if not!.</p>
  
  <p>My main question is, what all type of redirection cURL will be able to know? 
  Apache redirect, javascript redirects, form submition redirects, meta-refresh redirects!?</p>
  
  <p><strong>update</strong>
  Thanks for your answeres @ceejayoz and @Josso. So is there a way by which I can follow all the redirect programatically through php?</p>