PublicDomainSuffix()
Validates whether the input is a public ICANN domain suffix.
v::publicDomainSuffix->isValid('co.uk'); // true
v::publicDomainSuffix->isValid('CO.UK'); // true
v::publicDomainSuffix->isValid('nom.br'); // true
v::publicDomainSuffix->isValid('invalid.com'); // falseThis validator will not match top level domains such as tk.
If you want to match either, use a combination with Tld:
v::oneOf(v::tld(), v::publicDomainSuffix())->isValid('tk'); // true| Mode | Template |
|---|---|
default |
{{subject}} must be a public domain suffix |
inverted |
{{subject}} must not be a public domain suffix |
| Placeholder | Description |
|---|---|
subject |
The validated input or the custom validator name (if specified). |
- Internet
| Version | Description |
|---|---|
| 2.3.0 | Created |
See also: