What is the difference between HTTP_HOST and SERVER_NAME in PHP?

前端 未结 10 2474
青春惊慌失措
青春惊慌失措 2020-11-22 07:07

What is the difference between HTTP_HOST and SERVER_NAME in PHP?

where:

  • HTTP_HOST === $_SERVER[\'HTTP_HOST\'
10条回答
  •  再見小時候
    2020-11-22 07:48

    $_SERVER['SERVER_NAME'] is based on your web servers configuration. $_SERVER['HTTP_HOST'] is based on the request from the client.

提交回复
热议问题