PHP: $_SERVER variables: $_SERVER[‘HTTP_HOST’] vs $_SERVER[‘SERVER_NAME’]
$_SERVER[‘SERVER_NAME’] gives the value of the server name as defined in host configuration (i.e for Apache the Apache .conf file). $_SERVER[‘HTTP_HOST’] gives you the domain name through which the current request is being fulfilled and is more directly related to the request. HTTP_HOST is typically more useful in most applications in that it relates directly to the request, … Read more