19 March 2014

There is an easy way to get the local IP of a server using PHP.

For PHP 5.3+

$ip = gethostbyname(gethostname());

For PHP 4.02+

$ip = gethostbyname(php_uname('n'));
Technologies:


blog comments powered by Disqus