Display Ads On This Blog

Banner Ads on scriptforphp.blogspot.com
Provides free php script for php developer.
Prix: € 5.00

Tuesday, August 4, 2009

how to integrate google search api for php

Contact Us

Hire PHP Web Developer

$url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=~car~insurance&rsz=large&hl=en&safe=off";

// 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.scriptforphp.blogspot.com");
$body = curl_exec($ch);
curl_close($ch);


// download json library file from Download Here

include('JSON/JSON.php');
$object = new Services_JSON();
$json = $object->decode($body);

echo '<pre>';
print_r($json);
exit;

3 comments:

  1. Its highly informative. I would be visiting your blog hereafter regularly to gather valuable information.
    http://www.2daybiz.com

    ReplyDelete
  2. Hi i am new bee here. I seen the information above it ill be more useful for me, its to good information to see in you blogs. ;-) Job Site Search Engine Script

    ReplyDelete
  3. In the post Finding and analysing Keyword position.it is useful for to find your site position in many search engines. You can choose multiple Search engines such as Google, Yahoo and Bing.You can also save your keywords which is used to find the keywordposition most of times.this is special offer only for this week.you can see One week Special Offer

    ReplyDelete