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