2018-06-09 05:16
浏览 37

为什么php官方文档php.net上没有关于$ _SERVER [HTTP_CLIENT_IP]的文档?

Why is there no documentation for $_SERVER[ HTTP_CLIENT_IP ] in php on official documentation

It seems like there have not have any kind documentation about $_SERVER[ HTTP_CLIENT_IP ] in the internet. Not even reference website such as tutorialpoint or w3school have information about this.

tutorial point:


Yet, there are many comments or tutorials in forums uses $_SERVER[ HTTP_CLIENT_IP ] to get a more accurate visitor's IP address. Such as:

stackoverflow questions:Will the value of a set $_SERVER['HTTP_CLIENT_IP'] be an empty string?

information stack exchange:

Also, there are mention about this in the user contributed notes in, but nothing official

So, is $_SERVER[ HTTP_CLIENT_IP ] actually a real thing as official documentation does not have information about this?

Can $_SERVER[ HTTP_CLIENT_IP ] actually get the "real" IP address of the visitor in a shared network? Thank You

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanou9739
    duanou9739 2018-06-09 05:23

    The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here. That said, a large number of these variables are accounted for in the » CGI/1.1 specification, so you should be able to expect those.


    HTTP_CLIENT_IP is not in CGI/1.1 specification and this name generates by web server. Because of this HTTP_CLIENT_IP may not be in docs.

    点赞 评论