Get Hostname IP
This code show how to get hostname IP in PHP
<?
function gethostip($hostname)
{
$aIPList = gethostbynamel($hostname);
$theIP = "$hostname IP is";
if (!$aIPList)
{
$theIP = "$hostname could not be resolved ";
}
else
{
foreach ($aIPList as $ip)
{
$theIP = $theIP . " $ip ";
}
}
return $theIP;
}
echo gethostip("www.gunungpring.com");
?>