PHP getmxrr() Function

❮ PHP Network Reference

Example

Return details of mail exchanger records (MX records):

<?php
$domain="w3schools.com";
if(getmxrr($domain,$mx_details)){
  foreach($mx_details as $key=>$value){
    echo "$key => $value <br>";
  }
}
?>


Definition and Usage

The getmxrr() function returns the MX records for the specified internet host name.

Syntax

getmxrr(host, mxhosts, weight)

Parameter Values

Parameter Description
host Required. Specifies the host name
mxhosts Required. An array that specifies a list of MX records found
weight Optional. An array that specifies the weight information gathered


Technical Details

Return Value: TRUE if any records are found, FALSE otherwise
PHP Version: 4.0+
PHP Changelog: PHP 5.3: Now available on Windows platforms

❮ PHP Network Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.