| // +----------------------------------------------------------------------+ // // Specific validation methods for data used in DE // require_once('Validate.php'); class Validate_DE { /** * Validate a German postcode * * @param string postcode to validate * @param bool optional; strong checks (e.g. against a list of postcodes) * @return bool true if postcode is ok, false otherwise */ function postcode($postcode, $strong=false) { // $strong is not used here at the moment; added for API compatibility // checks might be added at a later stage return (ereg('^[0-9]{5}$', $postcode)); } /** * Validate a German bankcode * * German bankcodes consist of exactly 8 numbers * * @param string $postcode German bankcode to validate * @return bool true if bankcode is ok, false otherwise */ function bankcode($postcode) { return (ereg('^[0-9]{8}$', $postcode)); } } ?>