September 2001
Intermediate to advanced
768 pages
32h 45m
English
array gethostbynamel(string hostname) Gets multiple IP addresses for an Internet host.
Returns:
Array of IP addresses
Description:
gethostbynamel() performs a DNS lookup of an Internet hostname and returns a list of corresponding IP addresses. This is useful for Web sites that use “round-robin DNS”—a form of load-balancing whereby one domain name resolves to multiple IP addresses. If no IP address can be found for the specified hostname, the function returns an empty array.
Availability:
UNIX, Windows
Version:
3+, 4+
See also:
gethostbyaddr() gethostbyname()
Example:
<?php $host = 'www.w3c.org'; $ips = gethostbynamel ($host); if (0 == count ($ips)) { echo "I could not successfully ... |
Read now
Unlock full access