respect-validation/docs/rules/Digit.md

46 lines
914 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Digit
- `Digit()`
- `Digit(string ...$additionalChars)`
2015-01-30 09:40:06 +01: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
v::digit('.', '-')->validate('172.655.537-21'); // true
```
2015-01-30 09:40:06 +01:00
## Categorization
- Numbers
- Strings
## Changelog
Version | Description
--------|-------------
2.0.0 | Removed support to whitespaces by default
0.5.0 | Renamed from `Digits` to `Digit`
0.3.9 | Created as `Digits`
***
2015-01-30 09:40:06 +01:00
See also:
- [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)
- [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)