I need to get local IP of computer like 192.*.... Is this possible with PHP?
I need IP address of system running the script, but I do not need the external IP, I need his local network card address.
Using getenv() function: To get the IP Address,we use getenv(“REMOTE_ADDR”) command. The getenv() function in PHP is used for retrieval of values of an environment variable in PHP. It is used to return the value of a specific environment variable.
You can try this one also. $ip=$_SERVER['REMOTE_ADDR']; echo "IP address= $ip"; 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.
var ip = HttpContext. Current. Request. ServerVariables["REMOTE_ADDR"]; var ip = Request.
$localIP = getHostByName(php_uname('n'));
$localIP = getHostByName(getHostName());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With