mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 07:15:45 +01:00
Since we now have PHP ISO Codes as a dependency[1], it doesn't make
sense to keep dealing with this data ourselves.
[1]: 04b2722d02
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
999 B
999 B
LanguageCode
LanguageCode()LanguageCode("alpha-2"|"alpha-3" $set)
Validates whether the input is language code based on ISO 639.
This rule requires sokil/php-isocodes and sokil/php-isocodes-db-only to be installed.
v::languageCode()->validate('pt'); // true
v::languageCode()->validate('en'); // true
v::languageCode()->validate('it'); // true
v::languageCode('alpha-3')->validate('ita'); // true
v::languageCode('alpha-3')->validate('eng'); // true
This rule supports the twoISO 639 sets:
alpha-2alpha-3
Categorization
- ISO codes
- Localization
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Require sokil/php-isocodes and sokil/php-isocodes-db-only |
| 1.1.0 | Created |
See also: