respect-validation/docs/PostalCode.md
Henrique Moody 2a2e1d577e
Change how documentation of rules are presented
Rules are not always used from the alias `v`, neither called staticaly.
2017-03-27 17:26:21 +02:00

546 B

PostalCode

  • PostalCode(string $countryCode)

Validates a postal code according to the given country code.

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.


See also: