public static function getVd(int $num)
    {
        $i = 2;
        $sum = 0;

        foreach (array_reverse(str_split($num)) as $v) {
            if ($i === 8) $i = 2;
            $sum += $v * $i;
            ++$i;
        }

        $dig = 11 - ($sum % 11);

        if ($dig === 11) $dig = 0;
        if ($dig === 10) $dig = 'K';

        return $dig;
    }
public static function getVd(int $num)
    {
        $i = 2;
        $sum = 0;

        foreach (array_reverse(str_split($num)) as $v) {
            if ($i === 8) $i = 2;
            $sum += $v * $i;
            ++$i;
        }

        $dig = 11 - ($sum % 11);

        if ($dig === 11) $dig = 0;
        if ($dig === 10) $dig = 'K';

        return $dig;
    }
public static function getVd ( int $ num ) { $ i = 2 ; $ sum = 0 ; foreach ( array_reverse ( str_split ( $ num ) ) as $ v ) { if ( $ i === 8 ) $ i = 2 ; $ sum += $ v * $ i ; ++ $ i ; } $ dig = 11 - ( $ sum % 11 ) ; if ( $ dig === 11 ) $ dig = 0 ; if ( $ dig === 10 ) $ dig = 'K' ; return $ dig ; }
Get the Verification Digit from a given number

@internal
@param int $num
@return int|string
Get the Verification Digit from a given number