How to find IP address using PHP code | 2my4edge

22 September 2013

How to find IP address using PHP code

Here i'm going to show you that, how to find the IP address of you computer using php code, this coding is very simple one, this is actually one the basic thing in php, here i'm going to use only php code to get the real ip address of the network. let the the coding.
find ip address using php


function getRealIpAddress()
if (!empty($_SERVER['HTTP_CLIENT_IP']))
//check ip from internet
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
//check ip proxy
return $ipadd;
echo getRealIpAddress(); // display IP address
yes, you can get clear idea from the above code, that  is for find the original ip address of the network. i hope this tutorial is more helpful to everyone. thank you.

Detect Operating System and Detect the Browser using Php

Marquee style in different manner with PHP and MySql


  1. On localhost i get :::1 ip address using the above php coding for getting ip address why?? plz help me

  2. Localhost is the name of the server machine. It is used to test the network connection on the way to himself. Otherwise it is called a feedback loop. By default, IP4 address is set to and the IP6 address :: 1 When you connect from another computer to your site's IP checking, you should get the client IP.

  3. in result print localhost ip( i can not get my system ip plz help me..
    thank you.