title: file_get_contents is not able to read image from facebook image url
body: <p>I have got an image url from facebook:</p>
  
  <pre><code>https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-prn1/s720x720/156510_443901075651849_1975839315_n.jpg
  </code></pre>
  
  <p>I need to save this in my local. when i used <code>file_get_contents</code> it gave error <code>failed to open stream</code>. when i open image in the browser it is showing fine. I just understand how to do it.</p>
  
  <p>infact i used curl in the following way and got no response at all</p>
  
  <p>$url = <a href="https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-prn1/s720x720/156510_443901085651849_1975839315_n.jpg" rel="nofollow">https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-prn1/s720x720/156510_443901085651849_1975839315_n.jpg</a>;</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  $response = curl_exec($ch);
  curl_close($ch);
  $filename = 'ex'.$src['photo_id'].'.jpg';
  $imgRes = imagecreatefromstring($response);
  imagejpeg($imgRes, $filename, 70);
  
  header("Content-Type: image/jpg");
  imagejpeg($imgRes, NULL, 70);
  </code></pre>