国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

php訪問(wèn)google search api的方法

Original 2016-11-10 14:13:02 675
abstract:這篇手記主要介紹了php訪問(wèn)google search api的方法,實(shí)例分析了php針對(duì)谷歌api訪問(wèn)的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下下面的代碼段演示了如何從php向ajax搜索api發(fā)送請(qǐng)求。請(qǐng)注意,此示例假定使用 php 5.2。對(duì)于較早安裝的 php,請(qǐng)參考對(duì)應(yīng)的官方注釋。$url = ;    // sendreques

這篇手記主要介紹了php訪問(wèn)google search api的方法,實(shí)例分析了php針對(duì)谷歌api訪問(wèn)的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下

下面的代碼段演示了如何從php向ajax搜索api發(fā)送請(qǐng)求。請(qǐng)注意,此示例假定使用 php 5.2。對(duì)于較早安裝的 php,請(qǐng)參考對(duì)應(yīng)的官方注釋。

$url = ; 
 
// 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, ); 
 
$body = curl_exec($ch); 
 
curl_close($ch); 
 
// now, process the json string 
 
$json = json_decode($body); 
 
// now have some fun with the results...

希望本手記所述對(duì)大家的php程序設(shè)計(jì)有所幫助。

Release Notes

Popular Entries