2016-08-06 8 views
-1

は、実際に私は例は、Googleカスタム検索APIからJSONレスポンスを取得する方法を

質問

占星術の定義は何のためにGoogleとその答え から質問を検索したいです。 答え

人間の仕事と自然界に影響を及ぼすと解釈される天体の動きと相対位置の研究。ここではそれが可能であるか、このAPIから

私が望むような

$search_query = $this->input->post('search'); 
    $url ="https://www.googleapis.com/customsearch/v1?key=AIzaSyD7Ho22AiuqaieQmg1GyMP9HxvID0V0VWg&cx=003432080158696714251:n4rbif5gizk&q='$search_query'"; 

答えて

0

は、サンプルコードです。

$json = file_get_contents($url); 

$results = json_decode($json); 

if ($results->searchInformation->totalResults) { 
    $resutItems = $results->items; 
    // do whatever with the result 
} 
関連する問題