Jump to content

[SOLVED] Reg Exp for google keywords


darkdmr

Recommended Posts

About my site:
Google finds it by some keywords. I want to make a php script to get the keyword by the GOOGLE URL.
For example

http://www.google.bg/search?q=sportingbet+info&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

I see it found me by the keyword "Sportingbet info".
I try it that way :
preg_match_all ('/q=(.+)&/', $url, $matches)

but in matches it returns :

q=sportingbet+info&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

How to make it return

q=sportingbet+info

10x.
Link to comment
Share on other sites

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.