Voting

: max(one, eight)?
(Example: nine)

The Note You're Voting On

php at nemon dot be
9 years ago
Always add the root . at the end or your server can add it's own suffix.
example: abc.com could become abc.com.yourcompany.com if you don't use abc.com.

I also find this function a litle bit limited because it doesn't tell you if the resolve failed.

TO adress all those issues I use :

function host2ip($host)
{
$host=trim($host.'.'); // clean and add root .
$ip= gethostbyname($host);
if($ip==$host) $ip='';// empty IP if there is no ip
return $ip;
}

<< Back to user notes page

To Top