2015-01-30 09:40:06 +01:00
|
|
|
# Digit
|
|
|
|
|
2017-03-27 14:47:07 +02:00
|
|
|
- `Digit()`
|
2018-09-24 21:48:41 +02:00
|
|
|
- `Digit(string ...$additionalChars)`
|
2015-01-30 09:40:06 +01:00
|
|
|
|
2018-09-06 21:57:57 +02:00
|
|
|
Validates whether the input contains only digits.
|
|
|
|
|
|
|
|
```php
|
|
|
|
v::digit()->validate('020 612 1851'); // false
|
|
|
|
v::digit(' ')->validate('020 612 1851'); // true
|
|
|
|
v::digit()->validate('172.655.537-21'); // false
|
2018-09-24 21:48:41 +02:00
|
|
|
v::digit('.', '-')->validate('172.655.537-21'); // true
|
2018-09-06 21:57:57 +02:00
|
|
|
```
|
2015-01-30 09:40:06 +01:00
|
|
|
|
2019-05-11 18:32:13 +02:00
|
|
|
## Categorization
|
|
|
|
|
|
|
|
- Numbers
|
|
|
|
- Strings
|
|
|
|
|
2017-03-27 22:04:13 +02:00
|
|
|
## Changelog
|
|
|
|
|
|
|
|
Version | Description
|
|
|
|
--------|-------------
|
2018-09-06 21:57:57 +02:00
|
|
|
2.0.0 | Removed support to whitespaces by default
|
2017-03-27 22:04:13 +02:00
|
|
|
0.5.0 | Renamed from `Digits` to `Digit`
|
|
|
|
0.3.9 | Created as `Digits`
|
|
|
|
|
2015-08-20 06:38:41 +02:00
|
|
|
***
|
2015-01-30 09:40:06 +01:00
|
|
|
See also:
|
|
|
|
|
2017-03-28 11:53:14 +02:00
|
|
|
- [Alnum](Alnum.md)
|
|
|
|
- [Alpha](Alpha.md)
|
|
|
|
- [Consonant](Consonant.md)
|
2018-12-11 13:31:50 +01:00
|
|
|
- [CreditCard](CreditCard.md)
|
|
|
|
- [Factor](Factor.md)
|
|
|
|
- [Finite](Finite.md)
|
|
|
|
- [Infinite](Infinite.md)
|
|
|
|
- [IntType](IntType.md)
|
|
|
|
- [IntVal](IntVal.md)
|
2019-01-27 01:14:47 +01:00
|
|
|
- [NotEmoji](NotEmoji.md)
|
2018-12-11 13:31:50 +01:00
|
|
|
- [NumericVal](NumericVal.md)
|
|
|
|
- [Regex](Regex.md)
|
|
|
|
- [Uuid](Uuid.md)
|
|
|
|
- [Vowel](Vowel.md)
|
|
|
|
- [Xdigit](Xdigit.md)
|