title: cURL get_data($url) with absolute URL
body: <p>I'm using this code to get data using cURL</p>
  
  <pre><code>$url='http://example.com/'; //URL to get content from..
  print_r(get_data($url)); //Dumps the content
  
  /* Gets the data from a URL */
  function get_data($url)
  {
  $ch = curl_init();
  $timeout = 5;
  curl_setopt($ch,CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
  $data = curl_exec($ch);
  curl_close($ch);
  return $data;
  }
  </code></pre>
  
  <p>However, This code returns data with relative url. How can I get ride of this relative url &amp; print with absolute url? May be with preg_replace.. But How ?</p>