Friday, February 1, 2002, 3:46:20 PM, Sébastien Thüler wrote:
> Woops, sorry! I didn't even notice that ;)

> My problem is concerning gethostbyname() function. The PHP manual (French
> version ;) states that function "returns IP address of host".
> So I tried the following :

>  $adresse = gethostbyname("http://www.blizzard.com";);

> to get the IP address of http://www.blizzard.com in $adresse.

> The funny thing is that $adresse contains 'http://www.blizzard.com' !

> Anyone could help ?

If gethostbyname() fails to resolve the host it returns the hostname.

<?php
$hostname = "www.blizzard.com"
if (gethostbyname($hostname) == $hostname) {
  print "Unable to resolve";
}
?>

Also you have to remove the http:// part as it only takes the host, not
urls as parameters.

-- 
Kjartan <[EMAIL PROTECTED]> (http://natrak.net/)
:: "Press any key... no, no, no, NOT THAT ONE!"


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to