English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The getmxrr() function retrieves the MX records corresponding to an Internet hostname
bool getmxrr ( string $hostname , array &$mxhosts [, array &$weight ] )
Search for the MX DNS record corresponding to hostname.
If a record is found, it will return True, otherwise it will return false
Try the following example
<?php getmxrr("baidu.com", $mx_records, $mx_weight); for($i = 0; $i < count($mx_records); $i++){ $mxs[$mx_records[$i]] = $mx_weight[$i]; } asort($mxs); $records = array_keys($mxs); for($i = 0; $i < count($records); $i++){ echo $records[$i]; echo '<br/>'; } ?>
The above example produces the following results
mx.maillb.baidu.com mx.n.shifen.com mx1.baidu.com jpmx.baidu.com mx50.baidu.com