$value) { $external_data["\$$key"] = $value; } // Final destination template with # placeholders // Example: https://final.com/page?e=#EMAIL# $final_template = "https://finaldestination.com/landing?e=#EMAIL#"; // Replace #EMAIL# with actual decoded email $final_url = str_replace('#EMAIL#', urlencode($email), $final_template); // Output redirection header header("Location: $final_url"); exit;