mirror of
https://github.com/Respect/Validation.git
synced 2024-06-26 17:20:16 +02:00
743 B
743 B
PostalCode
PostalCode(string $countryCode)
Validates whether the input is a valid postal code or not.
v::postalCode('BR')->validate('02179000'); // true
v::postalCode('BR')->validate('02179-000'); // true
v::postalCode('US')->validate('02179-000'); // false
v::postalCode('US')->validate('55372'); // true
v::postalCode('PL')->validate('99-300'); // true
Message template for this validator includes {{countryCode}}
.
Extracted from GeoNames.
Categorization
- Localization
- Strings
Changelog
Version | Description |
---|---|
2.2.4 | Cambodian postal codes now support 5 and 6 digits |
0.7.0 | Created |
See also: