remote_addr not returning IPv4 address

前端 未结 4 569
说谎
说谎 2020-12-30 08:56

I am using xampp on localhost and when I use $_SERVER[\"REMOTE_ADDR\"] it returns ::1 (also does this in phpinfo()). Why does it do th

4条回答
  •  青春惊慌失措
    2020-12-30 09:42

    ::1 is an IPv6 address and an abbreviation for 0:0:0:0:0:0:0:1 that is the loopback address to the local machine. So ::1 is the same as 127.0.0.1 only via IPv6 instead of IPv4.

提交回复
热议问题