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.
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.
It is easy one. You can get the host name by this simple code.
Or you can also use
$_SERVER['HTTP_HOST']
to get the hostname.Try this
From CLI
PHP < 5.3.0
$localIP = getHostByName(php_uname('n'));
PHP >= 5.3.0
$localIP = getHostByName(getHostName());