HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

getmxrr

Description

The getmxrr of Network for PHP gets MX records corresponding to a given Internet host name.

Syntax

getmxrr(
    string $hostname,
    array &$hosts,
    array &$weights = null
): bool

Parameters

hostname

The Internet host name.

mxhosts

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

weights

If the weights 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);

print_r($mxhosts);
Array
(
    [0] => php-smtp4-ip4.php.net
)

2 · weights

<?

$hostname = "php.net";

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

print_r($weights);
Array
(
    [0] => 0
)

3 · return

<?

$hostname = "php.net";

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

var_export($return);
true