What is the correct syntax for passing multiple GET variables in a URL in PHP?

When passing multiple GET variables in a URL in PHP, you need to separate each variable with an ampersand (&). Each variable should be in the format key=value. For example, if you want to pass two variables, you would construct the URL like this: example.com/page.php?var1=value1&var2=value2.

// Constructing a URL with multiple GET variables
$var1 = 'value1';
$var2 = 'value2';
$url = 'example.com/page.php?var1=' . urlencode($var1) . '&var2=' . urlencode($var2);

// Redirect to the constructed URL
header('Location: ' . $url);
exit();