September 2001
Intermediate to advanced
768 pages
32h 45m
English
string gethostbyaddr(string IP_address) Gets the human-readable name for an IP address.
Returns:
Internet hostname; IP_address argument on error
Description:
gethostbyaddr() performs a DNS lookup of an Internet IP address and returns the corresponding domain name. If no name exists, the function returns the IP_address argument.
Availability:
UNIX, Windows
Version:
3+, 4+
See also:
gethostbyname() gethostbynamel()
Example:
<?php $ip = '18.29.1.31'; $host = gethostbyaddr ($ip); if ($ip != $host) echo "The hostname for <i>$ip</i> is <i>$host</i>."; else echo "I could not successfully look up <i>$ip</i>."; ?> |
Read now
Unlock full access