src/Validation.php
public static function mod11Pre($number, $base = 9)
    {
        $checksum = 0;
        $factor = 2;
        foreach (str_split(strrev((string) $number)) as $d) {
            $checksum += $d * $factor;
            if (++$factor > $base) {
                $factor = 2;
            }
        }
        return $checksum;
    }
public static function mod11Pre($number, $base = 9)
    {
        $checksum = 0;
        $factor = 2;
        foreach (str_split(strrev((string) $number)) as $d) {
            $checksum += $d * $factor;
            if (++$factor > $base) {
                $factor = 2;
            }
        }
        return $checksum;
    }
public static function mod11Pre ( $ number , $ base = 9 ) { $ checksum = 0 ; $ factor = 2 ; foreach ( str_split ( strrev ( ( string ) $ number ) ) as $ d ) { $ checksum += $ d * $ factor ; if ( ++ $ factor > $ base ) { $ factor = 2 ; } } return $ checksum ; }
Calculates modulus 11 but do not apply the modulus

Useful when some calculation is required before '% 11'

@param mixed   $number Numeric value whose check digit will be calculated
@param integer $base   Maximum multiplication value

@return integer
Calculates modulus 11 but do not apply the modulus