Masks an IBAN so that the user still recognizes you, but no one else can do anything with it.
<?php
/**
* Masks an IBAN so that the user still recognizes you, but no one else can do anything with it.
* @param string $iban the iban to mask
* @param string $mask_character character/symbol to replace
* @return string masked iban
*/
function maskIBAN($iban, $mask_character = 'X') {
return substr($iban,0,4) . str_repeat( $mask_character, strlen($iban) - 8 ) . substr($iban, -4);
}