Funkcja PHP dns_get_record()
Przykład
Pobiera rekordy zasobów MX powiązane z „www.w3schools.com”:
<?php
print_r(dns_get_record("w3schools.com", DNS_MX));
?>
Definicja i użycie
Funkcja dns_get_record() pobiera rekordy zasobów DNS powiązane z określoną nazwą hosta.
Składnia
dns_get_record(hostname, type, authns, addtl, raw)
Wartości parametrów
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 |
Szczegóły techniczne
Wartość zwrotu: |
Tablica tablic asocjacyjnych, FALSE w przypadku niepowodzenia. Każda tablica zawiera następujące klucze (co najmniej):
Inne klucze w tablicach zależą od parametru typu . |
---|---|
Wersja PHP: | 5.0+ |
Dziennik zmian PHP: | PHP 7.0.16: Dodano obsługę typu DNS_CAA . PHP 5.4: Dodano surowy parametr. PHP 5.3: Dostępne na platformach Windows. |
❮ Informacje o sieci PHP