$currentUrl = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; echo $currentUrl;
$baseUrl = "http://example.com/page.php"; $queryString = http_build_query(array("a" => 1, "b" => 2)); $url = $baseUrl . "?" . $queryString; echo $url;
header("Location: http://example.com/newPage.php"); exit;This example redirects the user to a new page. Package/Library: None required.