<?php

$url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton";

// 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, "http://www.chrisdevbox.com/");
$body = curl_exec($ch);
//echo $body;
curl_close($ch);

// now, process the JSON string
$json = json_decode($body);
// now have some fun with the results...
?>
<html><head><title>PHP JSON / Google Search API Example</title><body>
<h1>Searching for Paris Hilton</h1>
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton
<br>
<pre>
<?php
print_r($json);
?>
</pre>
</body></html>