assertDomain.php
Table of Contents
Functions
- assertDomain() : bool
- Validates a domain name according to RFC rules and common DNS restrictions.
Functions
assertDomain()
Validates a domain name according to RFC rules and common DNS restrictions.
assertDomain(string $domain[, bool $throw = true ][, bool $requireTld = true ]) : bool
Parameters
- $domain : string
-
The domain name to validate (e.g. "example.com").
- $throw : bool = true
-
Whether to throw an exception on invalid domain.
- $requireTld : bool = true
-
Whether to require a TLD (default true).
Tags
Return values
bool —True if valid (or silent if $throw = true and valid).