title: PHP cURL vs file_get_contents
body: <p>How do these two pieces of code differ when accessing a REST API?</p>
  
  <pre><code>$result = file_get_contents('http://api.bitly.com/v3/shorten?login=user&amp;apiKey=key&amp;longUrl=url');
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$ch = curl_init('http://api.bitly.com/v3/shorten?login=user&amp;apiKey=key&amp;longUrl=url');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $result = curl_exec($ch);
  </code></pre>
  
  <p>They both produce the same result, judging by</p>
  
  <pre><code>print_r(json_decode($result))
  </code></pre>