PHP checkdnsrr() Functie
Voorbeeld
Controleer DNS-records:
<?php
$domain="w3schools.com";
if(checkdnsrr($domain,"MX")) {
echo
"Passed";
} else {
echo "Failed";
}
?>
Definitie en gebruik
De functie checkdnsrr() controleert DNS-records op type dat overeenkomt met host .
We kunnen de checkdnsrr()-functie gebruiken om ons DNS-record te controleren om het bestaan van een domeinnaam te verifiëren of niet.
Syntaxis
checkdnsrr(host, type)
Parameterwaarden
Parameter | Description |
---|---|
host | Required. Specifies an IP address or host name to check |
type | Optional. Specifies the type. Can be one of the following:
|
Technische details
Winstwaarde: | TRUE als er records worden gevonden, anders FALSE |
---|---|
PHP-versie: | 4.0+ |
PHP-wijzigingslogboek: | PHP 5.3: nu beschikbaar op Windows-platforms PHP 5.2.4: de TXT-waarde van het type toegevoegd |
❮ PHP-netwerkreferentie