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
https://forums.phpfreaks.com/topic/32405-solved-reg-exp-for-google-keywords/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.