public static function validate($code)
{
self::init();
if (strlen($code) !== 11) {
return false;
}
if ($code[4] !== '0') {
return false;
}
$bankCode = strtoupper(substr($code, 0, 4));
$branchCode = strtoupper(substr($code, 5));
if (!array_key_exists($bankCode, self::$data)) {
return false;
}
$list = self::$data[$bankCode];
if (ctype_digit($branchCode)) {
return static::lookupNumeric($list, $branchCode);
} else {
return static::lookupString($list, $branchCode);
}
}