Skip to content

Commit

Permalink
Added function to check address line for Germany (Straße und Hausnumm…
Browse files Browse the repository at this point in the history
…er).
  • Loading branch information
lenzcom committed Mar 26, 2010
1 parent beb3309 commit fb206bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/de_validation.php
Expand Up @@ -37,5 +37,16 @@ function postal($check) {
$pattern = '/^[0-9]{5}$/';
return preg_match($pattern, $check);
}
/**
* Checks address line for Germany (Straße und Hausnummer)
*
* @param string $check The value to check.
* @return boolean
* @access public
*/
function addressline($check) {
$pattern = '/[a-zA-ZäöüÄÖÜ \.]+ [0-9]+[a-zA-Z]?/';
return preg_match($pattern, $check);
}
}
?>

0 comments on commit fb206bf

Please sign in to comment.