Hàm dns_get_mx () trong PHP
Thí dụ
Trả lại chi tiết của bản ghi trình trao đổi thư (bản ghi MX):
<?php
$domain="w3schools.com";
if(dns_get_mx($domain,$mx_details)){
foreach($mx_details as $key=>$value){
echo "$key =>
$value <br>";
}
}
?>
Định nghĩa và Cách sử dụng
Hàm dns_get_mx () là một bí danh của hàm getmxrr () .
Cú pháp
dns_get_mx(host, mxhosts, weight)
Giá trị tham số
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 |
Chi tiết kỹ thuật
Giá trị trả lại: | TRUE nếu tìm thấy bất kỳ bản ghi nào, nếu không thì FALSE |
---|---|
Phiên bản PHP: | 5.0+ |
❮ Tham chiếu mạng PHP