I run this code:
<?php
$test = $_SERVER['HTTP_HOST'];
var_dump($test);
print_r($test);
die();
I run this code:
<?php
$test = $_SERVER['HTTP_HOST'];
print_r($test);
var_dump($test);
die();
Why can't print_r()
and var_dump()
agree on the value of $test in case 1?
For context on how I arrived here. I am running a laravel/homestead vm box, and I'm using Browsersync. Browsersync creates a proxy (localhost:3000
) that I connect to, which points to the laravel/homestead vm (192.168.10.10
). The proxy changes the value of the Host
header when the request passes through it.