title: cURL 'malformed url'
body: <p>This url</p>
  
  <p>'<a href="http://profile.myspace.com/index.cfm?fuseaction=user.viewProfile&amp;friendID=39726387" rel="noreferrer">http://profile.myspace.com/index.cfm?fuseaction=user.viewProfile&amp;friendID=39726387</a>'</p>
  
  <p>works perfectly well in a browser but cURL return's error 3 (malformed url).</p>
  
  <p>Any ideas on a work around?</p>
  
  <p>EDIT:</p>
  
  <p>cURL code:</p>
  
  <pre><code>function get_web_page( $url )
  {
      $options = array(
          CURLOPT_RETURNTRANSFER =&gt; true,     // return web page
          CURLOPT_HEADER         =&gt; false,    // don't return headers
          CURLOPT_FOLLOWLOCATION =&gt; true,     // follow redirects
          CURLOPT_ENCODING       =&gt; "",       // handle all encodings
          CURLOPT_USERAGENT      =&gt; "spider", // who am i
          CURLOPT_AUTOREFERER    =&gt; true,     // set referer on redirect
          CURLOPT_CONNECTTIMEOUT =&gt; 120,      // timeout on connect
          CURLOPT_TIMEOUT        =&gt; 120,      // timeout on response
          CURLOPT_MAXREDIRS      =&gt; 10,       // stop after 10 redirects
      );
  
      $ch      = curl_init( $url );
      curl_setopt_array( $ch, $options );
      $content = curl_exec( $ch );
      $err     = curl_errno( $ch );
      $errmsg  = curl_error( $ch );
      $header  = curl_getinfo( $ch );
      curl_close( $ch );
  
      if (!$errmsg =='') {die($err.':'.$errmsg);} 
      return $content;
  }
  </code></pre>