public function validate($vatNumber)
{
if (strlen($vatNumber) != 9) {
return false;
}
$checksum = $vatNumber[8];
$weights = array(256, 128, 64, 32, 16, 8, 4, 2);
$checkval = $this->sumWeights($weights, $vatNumber);
$checkval = $checkval % 11 > 9 ? 0 : $checkval % 11;
if ($checkval != $checksum) {
return false;
}
return true;
}