I am trying to extract value form an incoming request's header and then echo it back to the client, but this code doesn't seem to work.
<?php
$custom_header = $_SERVER['X-Forwarded-Host'];
echo "$custom_header";
?>
I am passing X-Forwarded-Host: google.com
as a header in the request and ideally I should get the response google.com
but the error that I get is Undefined index: X-Forwarded-Host in C:\xampp\htdocs\reflect.php
I'm running this script on my local machine using XAMPP.