Oihana PHP Commands

domainExists.php

Table of Contents

Functions

domainExists()  : bool
Checks whether the given domain has valid DNS records (A, AAAA, or CNAME).

Functions

domainExists()

Checks whether the given domain has valid DNS records (A, AAAA, or CNAME).

domainExists(string $domain) : bool
Parameters
$domain : string

The domain to check (e.g. "example.com").

Tags
example
$domain = 'example.com';

if ( domainExists( $domain ) )
{
    echo "$domain exists.\n";
}
else
{
   echo "$domain does NOT exist.\n";
}
author

Marc Alcaraz (ekameleon)

since
1.0.0
Return values
bool

True if DNS records exist for the domain, false otherwise.


        
On this page

Search results