title: How to get the last URL fetched by cURL?
body: <p>If a given URL is redirected to another one, <code>cURL</code> will fetch the last one by</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  </code></pre>
  
  <p>but how to record what was the last URL fetched by cURL?</p>
  
  <p>With</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_URL, $link);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  </code></pre>
  
  <p>we do not know what was the actuall url fetched by <code>cURL</code>, as <code>$link</code> has been redirected to the final location. How to record the last location in a string?</p>