public static function checkBIC($bic, array $options = null)
    {
        $bic = preg_replace('/\s+/u', '' , $bic );   // remove whitespaces

        if(!empty($options['forceLongBic']) && strlen($bic) === 8)
            $bic .= empty($options['forceLongBicStr']) ? 'XXX' : $options['forceLongBicStr'];

        if(empty($bic) && !empty($options['allowEmptyBic']))
            return '';

        $bic = strtoupper($bic);                    // use only capital letters

        if(preg_match('/^' . self::PATTERN_BIC . '$/', $bic))
            return $bic;
        else
            return false;
    }
public static function checkBIC($bic, array $options = null)
    {
        $bic = preg_replace('/\s+/u', '' , $bic );   // remove whitespaces

        if(!empty($options['forceLongBic']) && strlen($bic) === 8)
            $bic .= empty($options['forceLongBicStr']) ? 'XXX' : $options['forceLongBicStr'];

        if(empty($bic) && !empty($options['allowEmptyBic']))
            return '';

        $bic = strtoupper($bic);                    // use only capital letters

        if(preg_match('/^' . self::PATTERN_BIC . '$/', $bic))
            return $bic;
        else
            return false;
    }
public static function checkBIC ( $ bic , array $ options = null ) { $ bic = preg_replace ( '/\s+/u' , '' , $ bic ) ; // remove whitespaces if ( ! empty ( $ options [ 'forceLongBic' ] ) && strlen ( $ bic ) === 8 ) $ bic .= empty ( $ options [ 'forceLongBicStr' ] ) ? 'XXX' : $ options [ 'forceLongBicStr' ] ; if ( empty ( $ bic ) && ! empty ( $ options [ 'allowEmptyBic' ] ) ) return '' ; $ bic = strtoupper ( $ bic ) ; // use only capital letters if ( preg_match ( '/^' . self :: PATTERN_BIC . '$/' , $ bic ) ) return $ bic ; else return false ; }
Checks if a bic is valid. Note that also if the bic is valid it does not have to exist

@param string $bic
@param array  $options Takes the following keys:
- `allowEmptyBic`: (bool) The BIC can be empty.
- `forceLongBic`: (bool) If the BIC has exact 8 characters, `forceLongBicStr`
is added. (default false)
- `forceLongBicStr`: string (default 'XXX')
@return string|false the valid bic or false if it is not valid
Checks if a bic is valid . Note that also if the bic is valid it does not have to exist