Posted by ZeldorBlat on 08/12/05 17:26
If that was indeed the request URL then Michael's solution is the way
to go. If you're getting that string from somewhere else, you could
try something like this:
//$query contains everything after the ? :
$query = substr($refering_str, strrpos($refering_str, '?')+1);
$vars = parse_str($query); //$vars is an associative array of the
variables
$q = $vars['q'];
This will work even when the query string has many variables that are
in some random order.
Navigation:
[Reply to this message]
|