Hi there,
Try something like this (dunno if there's an easier way 🙂):
$string="http://www.asite.net/afile.php?this=that&query=thequery&me=good+fellow&bla=bla";
$string=explode("?", $string);
$string=strstr($string[1], "query");
$break=strpos($string, "&");
$string=substr($string, 0, $break);
echo $string;
Hope it will do the trick
Cheers