function _postal_code_validation_validate_BY in Postal Code Validation 7
Implements _postal_code_validation_validate_COUNTRYCODE().
File
- countries/
by.inc, line 11 - Postal code validation functions for Belarus.
Code
function _postal_code_validation_validate_BY($postal_code) {
$return = array(
'country' => 'BY',
);
if (preg_match('/^[0-9]{6}$/', $postal_code)) {
$return['postal_code'] = $postal_code;
}
else {
$return['error'] = t('Invalid postal code. Postal codes in Belarus are like "999999".');
}
return $return;
}