PHP dns_get_mx()関数
例
メールエクスチェンジャーレコード(MXレコード)の詳細を返します。
<?php
$domain="w3schools.com";
if(dns_get_mx($domain,$mx_details)){
foreach($mx_details as $key=>$value){
echo "$key =>
$value <br>";
}
}
?>
定義と使用法
dns_get_mx()関数は、getmxrr()関数のエイリアスです。
構文
dns_get_mx(host, mxhosts, weight)
パラメータ値
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 |
技術的な詳細
戻り値: | レコードが見つかった場合はTRUE、それ以外の場合はFALSE。 |
---|---|
PHPバージョン: | 5.0以降 |
❮PHPネットワークリファレンス