tags:

views:

173

answers:

2

what does the colon mean in php in the following example.

::1

if($host == "" || $ip == "::1")
+19  A: 

I think you are referring to the loopback adress of IPv6.

::1 is a "shortcut" for 0:0:0:0:0:0:0:1, which is the IPv6 version of 127.0.0.1 in IPv4.

The adress probably comes from $_SERVER['REMOTE_ADDR']

alexn
+2  A: 

Apache/PHP provides ::1 as the $_SERVER['REMOTE_ADDR'] value when accessing the server locally (the full IP address would be 127.0.0.1).

Joel L