getmxrr

Get MX records corresponding to a given Internet host name

Syntax

getmxrr ( string $hostname , array &$mxhosts [, array &$weight ] ) : bool

Parameters

hostname

The Internet host name.

mxhosts

A list of the MX records found is placed into the array mxhosts.

weight

If the weight array is given, it will be filled with the weight information gathered.

Return

Returns TRUE if any records are found; returns FALSE if no records were found or if an error occurred.

Examples

1 · hostname mxhosts

<?

$hostname = 'php.net';

$return = getmxrr($hostname, $mxhosts);

echo $return . PHP_EOL;
print_r($mxhosts);

?>
1
Array
(
    [0] => php-smtp4-ip4.php.net
)

2 · weight

<?

$hostname = 'php.net';

$return = getmxrr($hostname, $mxhosts, $weight);

echo $return . PHP_EOL;
print_r($mxhosts);
print_r($weight);

?>
1
Array
(
    [0] => php-smtp4-ip4.php.net
)
Array
(
    [0] => 0
)

checkdnsrr

closelog

dns_check_record

dns_get_mx

dns_get_record

fsockopen

gethostbyaddr

gethostbyname

gethostbynamel

gethostname

getprotobyname

getprotobynumber

getservbyname

getservbyport

header

header_register_callback

header_remove

headers_list

headers_sent

http_response_code

inet_ntop

inet_pton

ip2long

long2ip

openlog

pfsockopen

setcookie

setrawcookie

socket_get_status

socket_set_blocking

socket_set_timeout

syslog

PHP

Home Menu