嗨,我无法做到这一点。我想从这个返回的 json 结果
全文中获取 totalResults:http ://code.google.com/apis/customsearch/v1/using_rest.html
"request": [
{
"title": "Google Custom Search - flowers",
"totalResults": 10300000,
"searchTerms": "flowers",
}
]
},
我试过这个:
$response = file_get_contents('https://www.googleapis.com/customsearch/v1?key=INSERT-YOUR-KEY&cx=013036536707430787589:_pqjad5hr1a&q=flowers&alt=json
');
$json = json_decode($response);
echo "Total Result:".$json->request->totalResults;
但我什么也没有。需要帮助。谢谢。