Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

print("Description: $error_description
\n");
}
?>


string gethostbyaddr(string ip_address)


The gethostbyaddr function returns the name of the host specified by the numerical IP
address. If the host cannot be resolved, the address is returned.


<?
print(gethostbyaddr("207.46.131.30"));
?>


string gethostbyname(string hostname)


The gethostbyname function returns the IP address of the host specified by its name. It is
possible a domain name resolves to more than one IP address. To get each one, use
gethostbynamel.


<?
print(gethostbyname("www.php.net"));
?>


array gethostbynamel(string hostname)


The gethostbynamel function returns a list of IP addresses that a given hostname
resolves to.


<?
$hosts = gethostbynamel("www.microsoft.com");
for($index = 0; $index count($hosts); $index++)
{
print("$hosts[$index] BR>\n");
}
?>


boolean getmxrr(string host, array mxhost, array weight)


The getmxrr function gets mail-exchanger DNS records for a host. Hostnames will be
added to the array specified by the mxhost argument. The optional weight array is

Free download pdf