mirror of
https://github.com/Respect/Validation.git
synced 2026-03-15 14:55:44 +01:00
1.2 KiB
1.2 KiB
Base
Base(string $base)
Validate numbers in any base, even with non regular bases.
v::base(2)->isValid('011010001'); // true
v::base(3)->isValid('0120122001'); // true
v::base(8)->isValid('01234567520'); // true
v::base(16)->isValid('012a34f5675c20d'); // true
v::base(2)->isValid('0120122001'); // false
Templates
Base::TEMPLATE_STANDARD
| Mode | Template |
|---|---|
default |
{{subject}} must be a number in base {{base|raw}} |
inverted |
{{subject}} must not be a number in base {{base|raw}} |
Template placeholders
| Placeholder | Description |
|---|---|
base |
The base passed to the constructor of the validator. |
subject |
The validated input or the custom validator name (if specified). |
Categorization
- Numbers
Changelog
| Version | Description |
|---|---|
| 0.5.0 | Created |
See also: