私はこれをやろうとしています
$url = "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&"
. "q=Paris%20Hilton&userip=$_SERVER[SERVER_ADDR]";
// sendRequest
// note how referer is set manually
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, 'http://google.com');
$body = curl_exec($ch);
curl_close($ch);
// now, process the JSON string
$json = json_decode($body);
// now have some fun with the results...
それは彼らのドキュメントからかなり簡単ですが、何も返さないようですが、file_get_contentsはhttpsではなくhttpと同じURLに対して行います
curl にも http のみを使用してみましたが、うまくいきませんでした。どんな助けでも大歓迎です:)