这是我的代码。对10条记录可以正常工作。但是当我增加数字时它会提示错误。请检查它并让我知道你是否有任何解决方案。我无法通过谷歌搜索API获得50条结果记录
Thanks in advance,
Ravi Sharma
Softobiz Technologies
<?php
# JSON SEARCH RESULT
// This example request includes an optional API key which you will need to
// remove or replace with your own key.
// Read more about why it's useful to have an API key.
// The request also includes the userip parameter which provides the end
// user's IP address. Doing so will help distinguish this legitimate
// server-side traffic from traffic which doesn't come from an end-user.
$url = 'https://www.googleapis.com/customsearch/v1?key=AIzaSyC4o52-Q90FxNzMxY9FNryrONierFS3la8&cx=016278085151347603490%3Affuoqez1cew&q=ravi&num=20';
// sendRequest
// note how referer is set manually
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, '202.164.43.51');
$body = curl_exec($ch);
curl_close($ch);
// now, process the JSON string
$array = json_decode($body);
// now have some fun with the results...
echo "<pre>";
print_r($array);
?>
**你什么错误**? – SLaks