PHP and Regular Expressions

Status
Not open for further replies.

demos

Smack-Fu Master, in training
80
Ok, I'm trying to write a PHP script that will track all of the Google referrers to my site then print out the 5 most recent. That part is easy, however I want to strip the Google URL down to just the query. For example:

A Typical Google Search URL:
http://www.google.com/search?q=Anime Icon&start=60&sa=N

From what I can tell about Regular Expressions so far, the best way to accomplish this would be to removed everything before the first '=' and everything after the first '&', but the syntax of Regular Expressions is beyond me. I tried for an hour yesterday and all I got was a migraine. :confused:

Any Regular Expression Guru's out there care to lift a hand?
 
Status
Not open for further replies.