respect-validation/docs/rules/Charset.md

32 lines
567 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Charset
- `Charset(string ...$charset)`
2015-01-30 09:40:06 +01:00
Validates if a string is in a specific charset.
```php
v::charset('ASCII')->validate('açúcar'); // false
2015-01-30 09:40:06 +01:00
v::charset('ASCII')->validate('sugar'); //true
v::charset('ISO-8859-1', 'EUC-JP')->validate('日本国'); // true
2015-01-30 09:40:06 +01:00
```
The array format is a logic OR, not AND.
## Categorization
- Strings
## Changelog
Version | Description
--------|-------------
2.0.0 | Charset supports multiple charsets on its constructor
0.5.0 | Created
***
See also:
- [Alnum](Alnum.md)
- [Alpha](Alpha.md)
2018-12-11 13:31:50 +01:00
- [PhpLabel](PhpLabel.md)