‘::1’ means it is your localhost IP Address.
::1 == 127.0.0.1
You can try this one also.
<code><span class="pln">$ip</span><span class="pun">=</span><span class="pln">$_SERVER</span><span class="pun">[</span><span class="str">'REMOTE_ADDR'</span><span class="pun">];</span><span class="pln"> echo </span><span class="str">"IP address= $ip"</span><span class="pun">;</span></code>
If your application hosted on same machine from where you are trying to request it will always return ‘::1’, It means LocalHost. else it will return client IP Address.
Question and answer is powered by AnsPress.io