Regular Exp. Question / Request String Processing
Posted: Fri Dec 13, 2002 3:09 pm
So here's the task:
I have the following data:
or
or
or
(in others words i want to process all the cases in which a search engine can refer my site) and I would like to extract (match) the keywords. I know it's something like:
I just need the $pattern syntax which would match the keywords in all of my cases.
And is there a function of PHP to process the request strings into a more 'human friendly' form? Like replace + with space, and all those %XX characters with the corresponding alphanumeric data.
Thanks.
I have the following data:
Code: Select all
$referer = 'http://www.google.com.br/search?q=santa+claus+pictures&hl=pt&lr=&ie=UTF-8&oe=UTF-8&start=20&sa=N';Code: Select all
$referer = 'http://www.google.com/search?hl=ro&inlang=pl&ie=ISO-8859-2&q=santa+claus+pictures&btnG=Caut%E3&lr=';Code: Select all
$referer = 'http://www.google.com/search?hl=ro&inlang=pl&ie=ISO-8859-2&q=santa+claus+pictures';Code: Select all
$referer = 'http://www.google.com/search?q=santa+claus+pictures';Code: Select all
preg_match($pattern, $referer, $matches);
$keywords = $matchesї1];And is there a function of PHP to process the request strings into a more 'human friendly' form? Like replace + with space, and all those %XX characters with the corresponding alphanumeric data.
Thanks.