PHP dns_get_record() Fungsi
Contoh
Mendapatkan catatan sumber daya MX yang terkait dengan "www.w3schools.com":
<?php
print_r(dns_get_record("w3schools.com", DNS_MX));
?>
Definisi dan Penggunaan
Fungsi dns_get_record() mendapatkan catatan sumber daya DNS yang terkait dengan nama host yang ditentukan.
Sintaksis
dns_get_record(hostname, type, authns, addtl, raw)
Nilai Parameter
Parameter | Description |
---|---|
hostname | Required. Specifies a hostname (like "www.w3schools.com") |
type | Optional. Specifies the resource record type to search for. Can be one of the following:
|
authns | Optional. Passed by reference and, if set, it will be populated with Resource Records for the Authoritative Name Servers |
addtl | Optional. Passed by reference and, if set, it will be populated with any Additional Records |
raw | Optional. A Boolean value. If set to TRUE, it queries only the requested type instead of looping type-by-type before getting the info stuff. Default is FALSE |
Detail Teknis
Nilai Kembali: |
Sebuah array dari array asosiatif, FALSE pada kegagalan. Setiap array berisi kunci berikut (minimal):
Kunci lain dalam array tergantung pada parameter tipe . |
---|---|
Versi PHP: | 5.0+ |
Log Perubahan PHP: | PHP 7.0.16: Menambahkan dukungan untuk tipe DNS_CAA . PHP 5.4: Menambahkan parameter mentah . PHP 5.3: Tersedia di platform Windows. |
Referensi Jaringan PHP