Back to Validation

Tld

docs/validators/Tld.md

3.1.11.5 KB
Original Source
<!-- SPDX-License-Identifier: MIT SPDX-FileCopyrightText: (c) Respect Project Contributors SPDX-FileContributor: Alexandre Gomes Gaigalas <[email protected]> SPDX-FileContributor: Henrique Moody <[email protected]> SPDX-FileContributor: Paul Karikari <[email protected]> -->

Tld

  • Tld()

Validates whether the input is a top-level domain.

php
v::tld()->assert('com');
// Validation passes successfully

v::tld()->assert('ly');
// Validation passes successfully

v::tld()->assert('org');
// Validation passes successfully

v::tld()->assert('COM');
// Validation passes successfully

Templates

Tld::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be a top-level domain name
inverted{{subject}} must not be a top-level domain name

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Internet

Changelog

VersionDescription
3.0.0Templates changed
0.3.9Created

See Also