What is difference between $_SERVER['HTTP_HOST'] vs $_SERVER['SERVER_NAME']?

Ask Any Questions Answer’s are WaitingCategory: TechnologyWhat is difference between $_SERVER['HTTP_HOST'] vs $_SERVER['SERVER_NAME']?
SolutionsHint Staff asked 9 months ago

What is difference between $_SERVER[‘HTTP_HOST’] vs $_SERVER[‘SERVER_NAME’]

1 Answers
SolutionsHint Staff answered 9 months ago

$_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.