Hi,

Let's say I have a string (btw: this is a refferer to my site):

Code:
http://www.google.pl/search?somevar=someval&q=thisIsWhatIwant&q=f
I'm using this code to get the "q" value, trying to make the query bolded:

Code:
$ref=preg_replace("/([&|?])q=(.*?)&/","$1q=<b>$2</b>&",$ref);
But it doesn't work when "q" is the last value, that is when string is:

Code:
http://www.google.pl/search?somevar=someval&q=thisIsWhatIwant
How do I get the "q" value, that is a string between "q=" and the end of the string?