mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 15:25:45 +01:00
With this and the Lazy rule, the LazyConsecutive lost its purpose. While working on it, I did refactor the Domain rule a bit, but mainly to check how this rule could behave. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
1.1 KiB
1.1 KiB
SubdivisionCode
SubdivisionCode(string $countryCode)
Validates subdivision country codes according to ISO 3166-2.
The $countryCode must be a country in ISO 3166-1 alpha-2 format.
This rule requires sokil/php-isocodes and [php-isocodes-db-only][] to be installed.
v::subdivisionCode('BR')->validate('SP'); // true
v::subdivisionCode('US')->validate('CA'); // true
Categorization
- ISO codes
- Localization
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Require sokil/php-isocodes and sokil/php-isocodes-db-only |
| 1.0.0 | Created |
See also: