public static function isNationalTransaction($iban1, $iban2)
    {
        // remove whitespaces
        $iban1 = preg_replace('#\s+#','',$iban1);
        $iban2 = preg_replace('#\s+#','',$iban2);

        // check the country code
        if(stripos($iban1,substr($iban2,0,2)) === 0)
            return true;
        else
            return false;
    }
public static function isNationalTransaction($iban1, $iban2)
    {
        // remove whitespaces
        $iban1 = preg_replace('#\s+#','',$iban1);
        $iban2 = preg_replace('#\s+#','',$iban2);

        // check the country code
        if(stripos($iban1,substr($iban2,0,2)) === 0)
            return true;
        else
            return false;
    }
public static function isNationalTransaction ( $ iban1 , $ iban2 ) { // remove whitespaces $ iban1 = preg_replace ( '#\s+#' , '' , $ iban1 ) ; $ iban2 = preg_replace ( '#\s+#' , '' , $ iban2 ) ; // check the country code if ( stripos ( $ iban1 , substr ( $ iban2 , 0 , 2 ) ) === 0 ) return true ; else return false ; }
Checks if both IBANs do belong to the same country.
This function does not check if the IBANs are valid.

@param string $iban1
@param string $iban2
@return bool
Checks if both IBANs do belong to the same country . This function does not check if the IBANs are valid .