嗨,我正在尝试使用 php 程序进行谷歌搜索。结果即将到来,但我只得到四个结果。做什么建议..这是我的代码
<?php
$query = 'xyz';
$url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&num=10&q=".$query;
$body = file_get_contents($url);
$json = json_decode($body);
print_r($json);
for($x=0;$x<count($json->responseData->results);$x++){
echo "<b>Result ".($x+1)."</b>";
echo "<br>URL: ";
echo $json->responseData->results[$x]->url;
echo "<br>VisibleURL: ";
echo $json->responseData->results[$x]->visibleUrl;
echo "<br>Title: ";
echo $json->responseData->results[$x]->title;
echo "<br>Content: ";
echo $json->responseData->results[$x]->content;
echo "<br><br>";
}
?>
请帮帮我...