REST API にアクセスするとき、これら 2 つのコードはどのように異なるのでしょうか?
$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))