Jump to content

Getting the top 5 url in google search using CUrl library


Recommended Posts

i have here a function that search google using curl library what i want is i want to return the top 5 url that what i dont knwo ho to do it anyone??thx

 

 

function curl_google($keyword){

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/search?hl=en&q='.urlencode($keyword).'&btnG=Google+Search&meta=');

curl_setopt($ch, CURLOPT_HEADER, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_FILETIME, true);

$data = curl_exec($ch);

curl_close($ch);

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.