[PHP] PHP 访问 Google Search API 谷歌搜索api →→→→→进入此内容的聊天室

来自 , 2019-04-06, 写在 PHP, 查看 136 次.
URL http://www.code666.cn/view/4ea83d95
  1. $url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton";
  2.  
  3. // sendRequest
  4. // note how referer is set manually
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_URL, $url);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt($ch, CURLOPT_REFERER, "http://yuncode.net");
  9. $body = curl_exec($ch);
  10.  
  11. // now, process the JSON string
  12. $json = json_decode($body);
  13. // now have some fun with the results...

回复 "PHP 访问 Google Search API 谷歌搜索api"

这儿你可以回复上面这条便签

captcha