$current_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
header("Location: http://www.example.com"); exit;
$query_string = $_SERVER['QUERY_STRING']; parse_str($query_string, $params); $id = $params['id'];This code parses the query string parameters of the current URL and retrieves the value of a specific parameter. The `$_SERVER` variable is used again to retrieve the query string (`$_SERVER['QUERY_STRING']`) and the `parse_str()` function is used to parse it into an array. In this case, we're retrieving the value of the `id` parameter. Package library: PHP core library