PHP cURL против file_get_contents
Как эти два фрагмента кода отличаются при доступе к REST API?
$result = file_get_contents('http://api.bitly.com/v3/shorten?login=user&apiKey=key&longUrl=url');
а также
$ch = curl_init('http://api.bitly.com/v3/shorten?login=user&apiKey=key&longUrl=url');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
Они оба дают одинаковый результат, судя по
print_r(json_decode($result))