PHP - How do I get a parameter value from $_SERVER['HTTP_REFERER']?
parse_str(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY), $queries);
echo $queries['q'];
References:
http://php.net/parse_url
http://php.net/parse_str
Try these:
parse_url()
: http://php.net/manual/en/function.parse-url.php.parse_str()
: http://www.php.net/manual/en/function.parse-str.php