function IsCusip(string $s) {
    if (strlen($s) != 9) return false;
    $sum = 0;
    for ($i = 0; $i <= 7; $i++) {
        $c = $s[$i];
        if (ctype_digit($c)) {
            
            $v = intval($c);
        } elseif (ctype_alpha($c)) {
            
            $position = ord(strtoupper($c)) - ord('A') + 1;
            $v = $position + 9;
        } elseif ($c == ) {
            $v = 36;
        } elseif ($c == ) {
            $v = 37;
        } elseif ($c == ) {
            $v = 38;
        } else {
            return false;
        }
        
        if ($i % 2 == 1) {
            $v *= 2;
        }
        
        $sum += floor($v / 10 ) + ( $v % 10 );
    }
    return ord($s[8]) - 48 == (10 - ($sum % 10)) % 10;
}

$cusips = array(,
                ,
                ,
                ,
                ,
                );

foreach ($cusips as $cusip) echo $cusip .  . (IsCusip($cusip)?  : ) . ;